rubix-point-server's People
rubix-point-server's Issues
On delete of modbus network the polling will not restart
@@@ START MODBUS POLL !!!
MODBUS DEBUG: {'network': ModbusNetwork(uuid = fc0c024d-24ff-43f4-9af2-4f5b7cec52f9), 'device': ModbusDevice(uuid = ae6b55f4-aa2f-4ed4-a942-e2586b42e61d), 'transport': <ModbusType.RTU: 0>, 'mod_device_address': 20, 'reg': 21765, 'mod_point_reg_length': 5, 'mod_point_type': <ModbusPointType.READ_HOLDING_REGISTERS: 2>, 'mod_point_data_type': <ModbusDataType.RAW: 0>, 'mod_point_data_endian': <ModbusDataEndian.BEB_BEW: 4>, 'write_value': 0.0}
MODBUS DEBUG: inside read_holding_registers_handle try and read {'type': <ModbusPointType.READ_HOLDING_REGISTERS: 2>}
MODBUS read_analogue, check reg_length
MODBUS: in function _set_data_length, check reg_length {'data_type': <ModbusDataType.RAW: 0>, 'reg_length': 5}
MODBUS read_analogue, check reg_length result then do modbus read {'unit': 20, 'reg_start': 21765, 'reg_length': 5, 'func': <ModbusPointType.READ_HOLDING_REGISTERS: 2>, 'read_holding_registers': <ModbusPointType.READ_HOLDING_REGISTERS: 2>, 'read_input_registers': <ModbusPointType.READ_DISCRETE_INPUTS: 1>}
DEBUG:pymodbus.transaction:Current transaction state - TRANSACTION_COMPLETE
DEBUG:pymodbus.transaction:Running transaction 172
DEBUG:pymodbus.transaction:SEND: 0x14 0x3 0x55 0x5 0x0 0x5 0x86 0xc1
DEBUG:pymodbus.framer.rtu_framer:Changing state to IDLE - Last Frame End - 1604536010.072183, Current Time stamp - 1604536011.215416
DEBUG:pymodbus.client.sync:New Transaction state 'SENDING'
DEBUG:pymodbus.transaction:Changing transaction state from 'SENDING' to 'WAITING FOR REPLY'
DEBUG:pymodbus.transaction:Changing transaction state from 'WAITING FOR REPLY' to 'PROCESSING REPLY'
DEBUG:pymodbus.transaction:RECV: 0x14 0x3 0xa 0x0 0x73 0x0 0x74 0x0 0x88 0x7f 0xff 0x7f 0xff 0xfa 0x9d
DEBUG:pymodbus.framer.rtu_framer:Getting Frame - 0x3 0xa 0x0 0x73 0x0 0x74 0x0 0x88 0x7f 0xff 0x7f 0xff
DEBUG:pymodbus.factory:Factory Response[ReadHoldingRegistersResponse: 3]
DEBUG:pymodbus.framer.rtu_framer:Frame advanced, resetting header!!
DEBUG:pymodbus.transaction:Adding transaction 20
DEBUG:pymodbus.transaction:Getting transaction 20
DEBUG:pymodbus.transaction:Changing transaction state from 'PROCESSING REPLY' to 'TRANSACTION_COMPLETE'
MODBUS DO READ HOLDING {'read': <pymodbus.register_read_message.ReadHoldingRegistersResponse object at 0x740fe150>}
MODBUS read_analogue, do modbus read read ReadRegisterResponse (5) reg_type holding
MODBUS _assertion, after modbus read read ReadRegisterResponse (5) reg_type holding
MODBUS DEBUG: inside read_holding_registers_handle AFTER read {'type': <ModbusPointType.READ_HOLDING_REGISTERS: 2>, 'val': 115, 'array': [115, 116, 136, 32767, 32767]}
MODBUS DEBUG: READ/WRITE WAS DONE TRANSPORT TYPE & VAL {'transport': <ModbusType.RTU: 0>, 'val': 115}
!!! END MODBUS POLL @@@
INFO:werkzeug:24.69.156.9 - - [05/Nov/2020 11:26:52] "OPTIONS /api/modbus/networks/fc0c024d-24ff-43f4-9af2-4f5b7cec52f9 HTTP/1.1" 200 -
MODBUS DEBUG: main looping function poll_point
@@@ START MODBUS POLL !!!
MODBUS DEBUG: {'network': ModbusNetwork(uuid = fc0c024d-24ff-43f4-9af2-4f5b7cec52f9), 'device': ModbusDevice(uuid = ae6b55f4-aa2f-4ed4-a942-e2586b42e61d), 'transport': <ModbusType.RTU: 0>, 'mod_device_address': 20, 'reg': 21764, 'mod_point_reg_length': 5, 'mod_point_type': <ModbusPointType.READ_HOLDING_REGISTERS: 2>, 'mod_point_data_type': <ModbusDataType.RAW: 0>, 'mod_point_data_endian': <ModbusDataEndian.BEB_BEW: 4>, 'write_value': 0.0}
MODBUS DEBUG: inside read_holding_registers_handle try and read {'type': <ModbusPointType.READ_HOLDING_REGISTERS: 2>}
MODBUS read_analogue, check reg_length
MODBUS: in function _set_data_length, check reg_length {'data_type': <ModbusDataType.RAW: 0>, 'reg_length': 5}
MODBUS read_analogue, check reg_length result then do modbus read {'unit': 20, 'reg_start': 21764, 'reg_length': 5, 'func': <ModbusPointType.READ_HOLDING_REGISTERS: 2>, 'read_holding_registers': <ModbusPointType.READ_HOLDING_REGISTERS: 2>, 'read_input_registers': <ModbusPointType.READ_DISCRETE_INPUTS: 1>}
DEBUG:pymodbus.transaction:Current transaction state - TRANSACTION_COMPLETE
DEBUG:pymodbus.transaction:Running transaction 173
DEBUG:pymodbus.transaction:SEND: 0x14 0x3 0x55 0x4 0x0 0x5 0xd7 0x1
DEBUG:pymodbus.framer.rtu_framer:Changing state to IDLE - Last Frame End - 1604536011.40231, Current Time stamp - 1604536012.572885
DEBUG:pymodbus.client.sync:New Transaction state 'SENDING'
DEBUG:pymodbus.transaction:Changing transaction state from 'SENDING' to 'WAITING FOR REPLY'
INFO:werkzeug:24.69.156.9 - - [05/Nov/2020 11:26:52] "DELETE /api/modbus/networks/fc0c024d-24ff-43f4-9af2-4f5b7cec52f9 HTTP/1.1" 204 -
DEBUG:pymodbus.transaction:Changing transaction state from 'WAITING FOR REPLY' to 'PROCESSING REPLY'
DEBUG:pymodbus.transaction:RECV: 0x14 0x3 0xa 0x7f 0xff 0x0 0x74 0x0 0x74 0x0 0x88 0x7f 0xff 0x5 0x9a
DEBUG:pymodbus.framer.rtu_framer:Getting Frame - 0x3 0xa 0x7f 0xff 0x0 0x74 0x0 0x74 0x0 0x88 0x7f 0xff
DEBUG:pymodbus.factory:Factory Response[ReadHoldingRegistersResponse: 3]
DEBUG:pymodbus.framer.rtu_framer:Frame advanced, resetting header!!
DEBUG:pymodbus.transaction:Adding transaction 20
DEBUG:pymodbus.transaction:Getting transaction 20
DEBUG:pymodbus.transaction:Changing transaction state from 'PROCESSING REPLY' to 'TRANSACTION_COMPLETE'
MODBUS DO READ HOLDING {'read': <pymodbus.register_read_message.ReadHoldingRegistersResponse object at 0x74a24e70>}
MODBUS read_analogue, do modbus read read ReadRegisterResponse (5) reg_type holding
MODBUS _assertion, after modbus read read ReadRegisterResponse (5) reg_type holding
MODBUS DEBUG: inside read_holding_registers_handle AFTER read {'type': <ModbusPointType.READ_HOLDING_REGISTERS: 2>, 'val': 32767, 'array': [32767, 116, 116, 136, 32767]}
MODBUS DEBUG: READ/WRITE WAS DONE TRANSPORT TYPE & VAL {'transport': <ModbusType.RTU: 0>, 'val': 32767}
!!! END MODBUS POLL @@@
MODBUS DEBUG: main looping function poll_point
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
File "/usr/lib/python3.7/threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
File "/home/pi/bac-rest/src/source_drivers/modbus/services/rtu_polling.py", line 47, in polling
poll_point(network, device, point, ModbusType.RTU)
File "/home/pi/bac-rest/src/source_drivers/modbus/services/modbus_functions/polling/poll.py", line 44, in poll_point
reg = point.reg
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/orm/attributes.py", line 287, in __get__
return self.impl.get(instance_state(instance), dict_)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/orm/attributes.py", line 718, in get
value = state._load_expired(state, passive)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/orm/state.py", line 652, in _load_expired
self.manager.deferred_scalar_loader(self, toload)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/orm/loading.py", line 1016, in load_scalar_attributes
raise orm_exc.ObjectDeletedError(state)
sqlalchemy.orm.exc.ObjectDeletedError: Instance '<ModbusPointModel at 0x740cfc10>' has been deleted, or its row is otherwise not present.
INFO:werkzeug:192.168.0.11 - - [05/Nov/2020 11:26:56] "GET /api/modbus/devices HTTP/1.1" 200 -
INFO:werkzeug:24.69.156.9 - - [05/Nov/2020 11:27:04] "POST /api/modbus/networks HTTP/1.1" 200 -
INFO:werkzeug:24.69.156.9 - - [05/Nov/2020 11:27:04] "POST /api/modbus/devices HTTP/1.1" 200 -
INFO:werkzeug:24.69.156.9 - - [05/Nov/2020 11:27:05] "POST /api/modbus/points HTTP/1.1" 200 -
INFO:werkzeug:24.69.156.9 - - [05/Nov/2020 11:27:05] "POST /api/modbus/points HTTP/1.1" 200 -
INFO:werkzeug:24.69.156.9 - - [05/Nov/2020 11:27:06] "POST /api/modbus/points HTTP/1.1" 200 -
INFO:werkzeug:192.168.0.11 - - [05/Nov/2020 11:27:06] "GET /api/modbus/devices HTTP/1.1" 200 -
INFO:werkzeug:24.69.156.9 - - [05/Nov/2020 11:27:06] "POST /api/modbus/points HTTP/1.1" 200 -
INFO:werkzeug:24.69.156.9 - - [05/Nov/2020 11:27:07] "POST /api/modbus/points HTTP/1.1" 200 -
INFO:werkzeug:24.69.156.9 - - [05/Nov/2020 11:27:08] "POST /api/modbus/points HTTP/1.1" 200 -
INFO:werkzeug:24.69.156.9 - - [05/Nov/2020 11:27:08] "POST /api/modbus/devices HTTP/1.1" 200 -
INFO:werkzeug:24.69.156.9 - - [05/Nov/2020 11:27:09] "POST /api/modbus/points HTTP/1.1" 200 -
INFO:werkzeug:24.69.156.9 - - [05/Nov/2020 11:27:09] "POST /api/modbus/points HTTP/1.1" 200 -
INFO:werkzeug:24.69.156.9 - - [05/Nov/2020 11:27:10] "POST /api/modbus/points HTTP/1.1" 200 -
INFO:werkzeug:24.69.156.9 - - [05/Nov/2020 11:27:10] "POST /api/modbus/points HTTP/1.1" 200 -
INFO:werkzeug:24.69.156.9 - - [05/Nov/2020 11:27:11] "POST /api/modbus/points HTTP/1.1" 200 -
INFO:werkzeug:24.69.156.9 - - [05/Nov/2020 11:27:12] "POST /api/modbus/points HTTP/1.1" 200 -
INFO:werkzeug:24.69.156.9 - - [05/Nov/2020 11:27:13] "POST /api/modbus/devices HTTP/1.1" 200 -
INFO:werkzeug:24.69.156.9 - - [05/Nov/2020 11:27:13] "POST /api/modbus/points HTTP/1.1" 200 -
INFO:werkzeug:24.69.156.9 - - [05/Nov/2020 11:27:14] "POST /api/modbus/points HTTP/1.1" 200 -
INFO:werkzeug:24.69.156.9 - - [05/Nov/2020 11:27:14] "POST /api/modbus/points HTTP/1.1" 200 -
INFO:werkzeug:24.69.156.9 - - [05/Nov/2020 11:27:15] "POST /api/modbus/points HTTP/1.1" 200 -
INFO:werkzeug:24.69.156.9 - - [05/Nov/2020 11:27:15] "POST /api/modbus/points HTTP/1.1" 200 -
INFO:werkzeug:24.69.156.9 - - [05/Nov/2020 11:27:16] "POST /api/modbus/points HTTP/1.1" 200 -
INFO:werkzeug:192.168.0.11 - - [05/Nov/2020 11:27:16] "GET /api/modbus/devices HTTP/1.1" 200 -
INFO:werkzeug:24.69.156.9 - - [05/Nov/2020 11:27:26] "GET /api/modbus/networks HTTP/1.1" 200 -
INFO:werkzeug:192.168.0.11 - - [05/Nov/2020 11:27:26] "GET /api/modbus/devices HTTP/1.1" 200 -
INFO:werkzeug:24.69.156.9 - - [05/Nov/2020 11:27:34] "GET /api/modbus/networks HTTP/1.1" 200 -
INFO:werkzeug:49.181.153.31 - - [05/Nov/2020 11:27:35] "GET /api/modbus/networks HTTP/1.1" 200 -
INFO:werkzeug:192.168.0.11 - - [05/Nov/2020 11:27:36] "GET /api/modbus/devices HTTP/1.1" 200 -
INFO:werkzeug:49.181.153.31 - - [05/Nov/2020 11:27:39] "GET /api/modbus/networks HTTP/1.1" 200 -
INFO:werkzeug:192.168.0.11 - - [05/Nov/2020 11:27:46] "GET /api/modbus/devices HTTP/1.1" 200 -
INFO:werkzeug:192.168.0.11 - - [05/Nov/2020 11:27:56] "GET /api/modbus/devices HTTP/1.1" 200 -
INFO:werkzeug:192.168.0.11 - - [05/Nov/2020 11:28:06] "GET /api/modbus/devices HTTP/1.1" 200 -
INFO:schedule:Running job Every 5 minutes do clean() (last run: [never], next run: 2020-11-05 11:28:07)
Generic Point / Virtual Point
Migration on schema changes
Related: #126
Task:
- On the change of schema, we need migrate existing data into new schema compatible data.
Remove wires (platform details)
Its been added to s-mon as this is the only thing that is required now in our stack to be installed
UPDATE endpoints required attributes
Allow UPDATE (PUT
/PATCH
) endpoints don't require all attributes
will probs require rework to the rest_schema
stuff
MQTT retain on connection drop issue
If retain is true I think the mqtt lib will store all pubs locally if connection to broker drops
This is dangerous as if we have X COV
changes to turn on/off equipment this will publish X COV
s instantly, potentially rapidly powering the equipment on and off
- Need to retain only latest update somehow
Add config .ini config parser
- Add support to parse configuration from .ini file
- Read/Write data and configuration as our in house convention
- Development: from inside project
- Production: from
/data/<project>
Add JWT
Non urgent
only save point data in db on COV
To save a few steps ist better to save the value in the db only on change.
But as a safe gard maybe resave the value evey 100th loop or evey 15 min whatever is easier
Wires node
Requirements for Rubix Wires Point Node
User can have the abilltiy to
Search for the point name 2 ways
adding nodes into wires
I think to make this work we need to we need to get the point UUID on import
Option 1:
- Filter networks
- Filter devices
- filter points
Option 2:
- have 1 dropdown that list's all the points NETWORK NAME -> DEVICE NAME -> POINT NAME
See start of wires node
https://github.com/NubeIO/rubix-wires/tree/modbus/point-1WIP
Update bac-rest point over HTTP PATCH
All we will do is allow the user from wires to do a HTTP PATCH
Point value, point name over MQTT
The MQTT topic will listen for changes to the network, device or point
This could be updates the point name, point value (not sure if we need to handle update to the networks or devices)
See docs in the read me
https://github.com/NubeDev/bac-rest#mqtt-client
Transferring Wires flows:
- Keep bac-rest point creation separate to wires flow import for now
1. export and import bac-rest points
2. export and import wires flow
- if wires flow imported before points it will need to be restarted / updated in some way New
that way nothing needs to be stored in wires except point_name
even if large amount of points, only requests from bac-rest on startup
Small API changes
ping and return some basic info
So UI people have a common and easy to place to check service
Please add in a ping service
https://github.com/NubeDev/bacnet-flask/blob/master/src/system/resources/ping.py
Please remove old code as its not needed
https://github.com/NubeDev/bac-rest/blob/master/src/system/resources/systemctl_services.py
API for stack setting
Add end point for updating the same settings in the config file
Not test and my work already
add better end points for modbus
- Get all the devices on a network
- Get all the points on a devices
Read input register isnt working
Read input register isnt working
Error message Got non numeric value
Add in polling time
User can set how often we run a polling cycle
We need 2 settings:
- polling loop time (https://github.com/NubeIO/rubix-point-server/blob/master/src/source_drivers/modbus/services/modbus_polling.py#L24)
- delay between each individual request (somewhere like here https://github.com/NubeIO/rubix-point-server/blob/master/src/source_drivers/modbus/services/modbus_polling.py#L82)
- As with modbus RS485 there must be a 30ms delay between each 485 message. But this sometimes needs to be made larger when the network is noisy or for example modbus lora needs 5 secs between each request
MQTT allow multiple clients
change from a singleton or support multiple clients
i.e.
- client to local broker
- client to cloud broker
Store modbus array in DB
This is the arrary that needs to be point_store
in the db
'array': [16901, 21845]
<pymodbus.register_read_message.ReadHoldingRegistersResponse object at 0x7f0455735690>, 'array': [16901, 21845]}
Modbus client connection rework
client connection get/add is happening on a per point level. This is bad if lots of points and connection cannot be established
- Move to per
network
level to check if connection to network is possible - implement
device
ping_point
to ping device before attempting all points in device
add better return message on a delete of MODBUS point/network/device
Periodic Point Publish
Publish point values (same as COV event) for all points periodically
May not be needed. Discussion required
-
Nice to have so everything stays up to date...
- MQTT by default will retain the latest value for every topic and send this on ANY connection reset meaning periodic publishing could prevent us from finding any bugs in any of the services
-
Need way to tell if services go down / haven't received update for long time
- Periodic pushes might prevent this from being detectable depending on how it's implemented
-
global service level would not allow for detection
-
source_driver level would allow for detection (
EventServiceBase._internal_timeout_thread
will need tweaking for multiple timeouts. i.e. normal poll loop and point re-publish loop)- i.e. driver publishes points on a loop for example 60 point = 1 hour loop = 1 point every minute
-
This will create unnecessary histories unless unless handled for (might be hacking and over complicated to handle)
-
- REST endpoint might be better way to detect service status
- Periodic pushes might prevent this from being detectable depending on how it's implemented
Add modbus TCP/RTU polling
Please start with TCP first as you can test TCP
See TCP example
https://github.com/NubeDev/bac-rest/blob/main/src/services/modbus/tcp_poll_test.py
See RTU example
https://github.com/NubeDev/bac-rest/blob/main/src/services/modbus/main.py
Add tags/units
Tags
Rules for tags
- Force all tags to be lower case
- if there is a gap add an underscore
- no special characters
Enter Manual Tags
See point tags/units example.
Let user add tags. Will be like temp, humidity, light
Auto Tags
Add tags auto like network_name, device_name, point_name, protocal
units
Add field for units. Type string
filter_by(...).update(...) is not working in inheritance
filter_by(...).update(...) is not working in inheritance
I think I might know the problem with this.
https://hackersandslackers.com/database-queries-sqlalchemy-orm/#:~:text=Unlike%20filter()%20%2C%20filter_by(),match%20the%20arguments%20we%20pass
Unlike filter(), filter_by() accepts keyword arguments (note the difference in syntax here: filter() checks a conditional against a column object whereas filter_by() finds columns which match the arguments we pass). filter_by() can only search for exact values and serves as a kind of shorthand for simple filtering queries.
Add Point Priority Array
BACnet-server code has an example
https://github.com/NubeIO/rubix-bacnet-server/blob/master/src/bacnet_server/models/model_priority_array.py#L4
Modbus Network/device/point database constraints
In general we need to make sure user doesn't add the same point address, device addess and network RTU port address
point
- modbus RTU point address unique per function type
device
- modbus RTU address unique per network
- modbus IP address unique per network
network
- RTU comm port unique
After PUT polling dosnt get reflected updates
if this is added it will work! db.session.close()
Not sure what is the correct way
results = db.session.query(ModbusNetworkModel, ModbusDeviceModel, ModbusPointModel). \
select_from(ModbusNetworkModel).filter_by(type=ModbusType.TCP) \
.join(ModbusDeviceModel).filter_by(type=ModbusType.TCP) \
.join(ModbusPointModel).all()
!!!db.session.close()!!
for network, device, point in results:
print(9999)
print(point.reg)
poll_point(network, device, point, 'tcp')
Ping point
The ping point type i think has been removed
Also we need to a way to disable this feature as its not required to do this
https://github.com/NubeIO/rubix-point-server/blob/master/src/source_drivers/modbus/models/device.py#L22
Please update mod_point_store table
Strore modbus point value and point array in point_store table
Also return thses values over the rest-api call
mod_point_fault
mod_point_value
mod_point_last_poll_timestamp
mod_point_value_array
mod_point_write_ok
Add meinheld worker to gunicorn
pip install meinheld
gunicorn -w8 flask:app -k meinheld.gmeinheld.MeinheldWorker
Add TS to MQTT payload
Point Data Types
Data types
- enum
- float
- string
- bool
Actions
- read
- write/write
Units
SI units (Would we also do conversion for unit types, like m/s to f/s)
Meta Tags
Like haystack tags or influx tags
Polling tread breaks database is locked
Seems it might be cause we are using threading
Maybe we need to consider postgress
Our future stack will support postgress as its used in chirpstack
MODBUS DEBUG: main looping function poll_point
@@@ START MODBUS POLL !!
MODBUS DEBUG: {'network': ModbusNetworkModel(bec30e14-53ee-4ef8-a631-a6065ee0d536), 'device': ModbusDeviceModel(a085510c-2c07-4598-8711-be438836dfbb), 'transport': <ModbusType.RTU: 0>, 'mod_device_addr_length': 2, 'mod_point_type': <ModbusPointType.READ_HOLDING_REGISTERS: 2>, 'mod_point_data_type': <ModbusDataType.RAW: 0>, 'mod_point_data_endian': <ModbusDataEndian.BEB_BEW: 4>, 'write_value': 0.0}
MODBUS DEBUG: inside read_holding_registers_handle try and read {'type': <ModbusPointType.READ_HOLDING_REGISTERS: 2>}
MODBUS read_analogue, check reg_length
MODBUS: in function _set_data_length, check reg_length {'data_type': <ModbusDataType.RAW: 0>, 'reg_length': 2}
232323
MODBUS read_analogue, check reg_length result then do modbus read {'unit': 1, 'reg_start': 7, 'reg_length': 2, 'func': <ModbusPointType.READ_HOLDING_REGISTERS: 2>, 'read_holding_registers': <ModbusPoin2>, 'read_input_registers': <ModbusPointType.READ_DISCRETE_INPUTS: 1>}
MODBUS DO READ HOLDING {'read': ModbusIOException('No Response received from the remote unit/Unable to decode response', 3)}
MODBUS read_analogue, do modbus read read Modbus Error: [Input/Output] No Response received from the remote unit/Unable to decode response reg_type holding
connects to port: /dev/ttyUSB2; Type Register: holding; Exception: Modbus Error: [Input/Output] No Response received from the remote unit/Unable to decode response
MODBUS ERROR: in poll main function 'NoneType' object is not subscriptable
!!! END MODBUS POLL @@
127.0.0.1 - - [25/Oct/2020 00:24:20] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 200 -
127.0.0.1 - - [25/Oct/2020 00:24:20] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 200 -
127.0.0.1 - - [25/Oct/2020 00:24:21] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 200 -
127.0.0.1 - - [25/Oct/2020 00:24:21] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 200 -
127.0.0.1 - - [25/Oct/2020 00:24:21] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 200 -
127.0.0.1 - - [25/Oct/2020 00:24:21] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 200 -
127.0.0.1 - - [25/Oct/2020 00:24:21] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 200 -
127.0.0.1 - - [25/Oct/2020 00:24:21] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 200 -
127.0.0.1 - - [25/Oct/2020 00:24:21] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 200 -
127.0.0.1 - - [25/Oct/2020 00:24:21] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 200 -
127.0.0.1 - - [25/Oct/2020 00:24:21] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 200 -
127.0.0.1 - - [25/Oct/2020 00:24:21] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 200 -
127.0.0.1 - - [25/Oct/2020 00:24:21] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 200 -
127.0.0.1 - - [25/Oct/2020 00:24:21] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 200 -
127.0.0.1 - - [25/Oct/2020 00:24:21] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 200 -
127.0.0.1 - - [25/Oct/2020 00:24:21] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 200 -
127.0.0.1 - - [25/Oct/2020 00:24:21] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 200 -
127.0.0.1 - - [25/Oct/2020 00:24:21] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 200 -
127.0.0.1 - - [25/Oct/2020 00:24:21] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 200 -
127.0.0.1 - - [25/Oct/2020 00:24:21] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 200 -
127.0.0.1 - - [25/Oct/2020 00:24:21] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 200 -
127.0.0.1 - - [25/Oct/2020 00:24:21] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 200 -
127.0.0.1 - - [25/Oct/2020 00:24:21] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 200 -
127.0.0.1 - - [25/Oct/2020 00:24:21] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 200 -
127.0.0.1 - - [25/Oct/2020 00:24:21] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 200 -
127.0.0.1 - - [25/Oct/2020 00:24:21] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 200 -
127.0.0.1 - - [25/Oct/2020 00:24:21] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 200 -
127.0.0.1 - - [25/Oct/2020 00:24:21] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 200 -
127.0.0.1 - - [25/Oct/2020 00:24:21] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 200 -
127.0.0.1 - - [25/Oct/2020 00:24:21] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 200 -
127.0.0.1 - - [25/Oct/2020 00:24:21] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 200 -
127.0.0.1 - - [25/Oct/2020 00:24:22] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 200 -
127.0.0.1 - - [25/Oct/2020 00:24:22] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 200 -
127.0.0.1 - - [25/Oct/2020 00:24:22] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 200 -
127.0.0.1 - - [25/Oct/2020 00:24:22] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 200 -
127.0.0.1 - - [25/Oct/2020 00:24:22] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 200 -
Exception in thread Thread-1:
Traceback (most recent call last):
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 771, in _commit_impl
self.engine.dialect.do_commit(self.connection)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 546, in do_commit
dbapi_connection.commit()
sqlite3.OperationalError: database is locked
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
File "/usr/lib/python3.7/threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
File "/home/pi/bac-rest/src/modbus/services/rtu_polling.py", line 44, in polling
poll_point(network, device, point, ModbusType.RTU)
File "/home/pi/bac-rest/src/modbus/services/modbus_functions/polling/poll.py", line 168, in poll_point
point_store.save_to_db()
File "/home/pi/bac-rest/src/modbus/models/point_store.py", line 23, in save_to_db
db.session.commit()
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/orm/scoping.py", line 163, in do
return getattr(self.registry(), name)(*args, **kwargs)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/orm/session.py", line 1042, in commit
self.transaction.commit()
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/orm/session.py", line 508, in commit
t[1].commit()
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1762, in commit
self._do_commit()
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1793, in _do_commit
self.connection._commit_impl()
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 773, in _commit_impl
self._handle_dbapi_exception(e, None, None, None, None)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1511, in _handle_dbapi_exception
sqlalchemy_exception, with_traceback=exc_info[2], from_=e
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
raise exception
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 771, in _commit_impl
self.engine.dialect.do_commit(self.connection)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 546, in do_commit
dbapi_connection.commit()
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) database is locked
(Background on this error at: http://sqlalche.me/e/13/e3q8)
127.0.0.1 - - [25/Oct/2020 00:24:27] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 500 -
Traceback (most recent call last):
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1277, in _execute_context
cursor, statement, parameters, context
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 593, in do_execute
cursor.execute(statement, parameters)
sqlite3.OperationalError: database is locked
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 2464, in __call__
return self.wsgi_app(environ, start_response)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 2450, in wsgi_app
response = self.handle_exception(e)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 272, in error_router
return original_handler(e)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_cors/extension.py", line 165, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 1867, in handle_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/_compat.py", line 38, in reraise
raise value.with_traceback(tb)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 272, in error_router
return original_handler(e)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_cors/extension.py", line 165, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/_compat.py", line 38, in reraise
raise value.with_traceback(tb)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 468, in wrapper
resp = resource(*args, **kwargs)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/views.py", line 89, in view
return self.dispatch_request(*args, **kwargs)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 583, in dispatch_request
resp = meth(*args, **kwargs)
File "/home/pi/bac-rest/src/modbus/resources/point/point_plural.py", line 57, in get
.join(filtered_partition_table, filtered_partition_table.c.point_uuid == device_points.c.uuid) \
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3373, in all
return list(self)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3535, in __iter__
return self._execute_and_instances(context)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3560, in _execute_and_instances
result = conn.execute(querycontext.statement, self._params)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1011, in execute
return meth(self, multiparams, params)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/sql/elements.py", line 298, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1130, in _execute_clauseelement
distilled_params,
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1317, in _execute_context
e, statement, parameters, cursor, context
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1511, in _handle_dbapi_exception
sqlalchemy_exception, with_traceback=exc_info[2], from_=e
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
raise exception
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1277, in _execute_context
cursor, statement, parameters, context
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 593, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) database is locked
[SQL: SELECT anon_1.uuid AS anon_1_uuid, anon_1.name AS anon_1_name, anon_1.reg AS anon_1_reg, anon_2.value AS anon_2_value, anon_2.fault AS anon_2_fault
FROM (SELECT mod_points.uuid AS uuid, mod_points.name AS name, mod_points.reg AS reg, mod_points.reg_length AS reg_length, mod_points.type AS type, mod_points.enable AS enable, mod_points.write_value A_type AS data_type, mod_points.data_endian AS data_endian, mod_points.data_round AS data_round, mod_points.data_offset AS data_offset, mod_points.timeout AS timeout, mod_points.timeout_global AS timeouuplicates AS prevent_duplicates, mod_points.prevent_duplicates_global AS prevent_duplicates_global, mod_points.created_on AS created_on, mod_points.updated_on AS updated_on, mod_points.device_uuid AS d
FROM mod_points
WHERE mod_points.device_uuid = ?) AS anon_1 JOIN (SELECT anon_3.id AS id, anon_3.value AS value, anon_3.value_array AS value_array, anon_3.fault AS fault, anon_3.fault_message AS fault_message, anon_3. point_uuid, anon_3.rank AS rank
FROM (SELECT mod_points_store.id AS id, mod_points_store.value AS value, mod_points_store.value_array AS value_array, mod_points_store.fault AS fault, mod_points_store.fault_message AS fault_message, mpoints_store.point_uuid AS point_uuid, rank() OVER (PARTITION BY mod_points_store.point_uuid ORDER BY mod_points_store.ts DESC) AS rank
FROM mod_points_store) AS anon_3
WHERE anon_3.rank = ?) AS anon_2 ON anon_2.point_uuid = anon_1.uuid]
[parameters: ('a085510c-2c07-4598-8711-be438836dfbb', 1)]
(Background on this error at: http://sqlalche.me/e/13/e3q8)
127.0.0.1 - - [25/Oct/2020 00:24:27] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 500 -
Traceback (most recent call last):
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1277, in _execute_context
cursor, statement, parameters, context
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 593, in do_execute
cursor.execute(statement, parameters)
sqlite3.OperationalError: database is locked
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 2464, in __call__
return self.wsgi_app(environ, start_response)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 2450, in wsgi_app
response = self.handle_exception(e)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 272, in error_router
return original_handler(e)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_cors/extension.py", line 165, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 1867, in handle_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/_compat.py", line 38, in reraise
raise value.with_traceback(tb)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 272, in error_router
return original_handler(e)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_cors/extension.py", line 165, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/_compat.py", line 38, in reraise
raise value.with_traceback(tb)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 468, in wrapper
resp = resource(*args, **kwargs)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/views.py", line 89, in view
return self.dispatch_request(*args, **kwargs)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 583, in dispatch_request
resp = meth(*args, **kwargs)
File "/home/pi/bac-rest/src/modbus/resources/point/point_plural.py", line 57, in get
.join(filtered_partition_table, filtered_partition_table.c.point_uuid == device_points.c.uuid) \
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3373, in all
return list(self)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3535, in __iter__
return self._execute_and_instances(context)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3560, in _execute_and_instances
result = conn.execute(querycontext.statement, self._params)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1011, in execute
return meth(self, multiparams, params)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/sql/elements.py", line 298, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1130, in _execute_clauseelement
distilled_params,
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1317, in _execute_context
e, statement, parameters, cursor, context
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1511, in _handle_dbapi_exception
sqlalchemy_exception, with_traceback=exc_info[2], from_=e
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
raise exception
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1277, in _execute_context
cursor, statement, parameters, context
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 593, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) database is locked
[SQL: SELECT anon_1.uuid AS anon_1_uuid, anon_1.name AS anon_1_name, anon_1.reg AS anon_1_reg, anon_2.value AS anon_2_value, anon_2.fault AS anon_2_fault
FROM (SELECT mod_points.uuid AS uuid, mod_points.name AS name, mod_points.reg AS reg, mod_points.reg_length AS reg_length, mod_points.type AS type, mod_points.enable AS enable, mod_points.write_value A_type AS data_type, mod_points.data_endian AS data_endian, mod_points.data_round AS data_round, mod_points.data_offset AS data_offset, mod_points.timeout AS timeout, mod_points.timeout_global AS timeouuplicates AS prevent_duplicates, mod_points.prevent_duplicates_global AS prevent_duplicates_global, mod_points.created_on AS created_on, mod_points.updated_on AS updated_on, mod_points.device_uuid AS d
FROM mod_points
WHERE mod_points.device_uuid = ?) AS anon_1 JOIN (SELECT anon_3.id AS id, anon_3.value AS value, anon_3.value_array AS value_array, anon_3.fault AS fault, anon_3.fault_message AS fault_message, anon_3. point_uuid, anon_3.rank AS rank
FROM (SELECT mod_points_store.id AS id, mod_points_store.value AS value, mod_points_store.value_array AS value_array, mod_points_store.fault AS fault, mod_points_store.fault_message AS fault_message, mpoints_store.point_uuid AS point_uuid, rank() OVER (PARTITION BY mod_points_store.point_uuid ORDER BY mod_points_store.ts DESC) AS rank
FROM mod_points_store) AS anon_3
WHERE anon_3.rank = ?) AS anon_2 ON anon_2.point_uuid = anon_1.uuid]
[parameters: ('a085510c-2c07-4598-8711-be438836dfbb', 1)]
(Background on this error at: http://sqlalche.me/e/13/e3q8)
127.0.0.1 - - [25/Oct/2020 00:24:28] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 500 -
Traceback (most recent call last):
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1277, in _execute_context
cursor, statement, parameters, context
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 593, in do_execute
cursor.execute(statement, parameters)
sqlite3.OperationalError: database is locked
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 2464, in __call__
return self.wsgi_app(environ, start_response)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 2450, in wsgi_app
response = self.handle_exception(e)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 272, in error_router
return original_handler(e)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_cors/extension.py", line 165, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 1867, in handle_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/_compat.py", line 38, in reraise
raise value.with_traceback(tb)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 272, in error_router
return original_handler(e)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_cors/extension.py", line 165, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/_compat.py", line 38, in reraise
raise value.with_traceback(tb)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 468, in wrapper
resp = resource(*args, **kwargs)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/views.py", line 89, in view
return self.dispatch_request(*args, **kwargs)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 583, in dispatch_request
resp = meth(*args, **kwargs)
File "/home/pi/bac-rest/src/modbus/resources/point/point_plural.py", line 57, in get
.join(filtered_partition_table, filtered_partition_table.c.point_uuid == device_points.c.uuid) \
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3373, in all
return list(self)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3535, in __iter__
return self._execute_and_instances(context)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3560, in _execute_and_instances
result = conn.execute(querycontext.statement, self._params)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1011, in execute
return meth(self, multiparams, params)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/sql/elements.py", line 298, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1130, in _execute_clauseelement
distilled_params,
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1317, in _execute_context
e, statement, parameters, cursor, context
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1511, in _handle_dbapi_exception
sqlalchemy_exception, with_traceback=exc_info[2], from_=e
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
raise exception
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1277, in _execute_context
cursor, statement, parameters, context
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 593, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) database is locked
[SQL: SELECT anon_1.uuid AS anon_1_uuid, anon_1.name AS anon_1_name, anon_1.reg AS anon_1_reg, anon_2.value AS anon_2_value, anon_2.fault AS anon_2_fault
FROM (SELECT mod_points.uuid AS uuid, mod_points.name AS name, mod_points.reg AS reg, mod_points.reg_length AS reg_length, mod_points.type AS type, mod_points.enable AS enable, mod_points.write_value A_type AS data_type, mod_points.data_endian AS data_endian, mod_points.data_round AS data_round, mod_points.data_offset AS data_offset, mod_points.timeout AS timeout, mod_points.timeout_global AS timeouuplicates AS prevent_duplicates, mod_points.prevent_duplicates_global AS prevent_duplicates_global, mod_points.created_on AS created_on, mod_points.updated_on AS updated_on, mod_points.device_uuid AS d
FROM mod_points
WHERE mod_points.device_uuid = ?) AS anon_1 JOIN (SELECT anon_3.id AS id, anon_3.value AS value, anon_3.value_array AS value_array, anon_3.fault AS fault, anon_3.fault_message AS fault_message, anon_3. point_uuid, anon_3.rank AS rank
FROM (SELECT mod_points_store.id AS id, mod_points_store.value AS value, mod_points_store.value_array AS value_array, mod_points_store.fault AS fault, mod_points_store.fault_message AS fault_message, mpoints_store.point_uuid AS point_uuid, rank() OVER (PARTITION BY mod_points_store.point_uuid ORDER BY mod_points_store.ts DESC) AS rank
FROM mod_points_store) AS anon_3
WHERE anon_3.rank = ?) AS anon_2 ON anon_2.point_uuid = anon_1.uuid]
[parameters: ('a085510c-2c07-4598-8711-be438836dfbb', 1)]
(Background on this error at: http://sqlalche.me/e/13/e3q8)
127.0.0.1 - - [25/Oct/2020 00:24:28] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 500 -
Traceback (most recent call last):
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1277, in _execute_context
cursor, statement, parameters, context
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 593, in do_execute
cursor.execute(statement, parameters)
sqlite3.OperationalError: database is locked
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 2464, in __call__
return self.wsgi_app(environ, start_response)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 2450, in wsgi_app
response = self.handle_exception(e)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 272, in error_router
return original_handler(e)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_cors/extension.py", line 165, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 1867, in handle_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/_compat.py", line 38, in reraise
raise value.with_traceback(tb)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 272, in error_router
return original_handler(e)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_cors/extension.py", line 165, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/_compat.py", line 38, in reraise
raise value.with_traceback(tb)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 468, in wrapper
resp = resource(*args, **kwargs)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/views.py", line 89, in view
return self.dispatch_request(*args, **kwargs)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 583, in dispatch_request
resp = meth(*args, **kwargs)
File "/home/pi/bac-rest/src/modbus/resources/point/point_plural.py", line 57, in get
.join(filtered_partition_table, filtered_partition_table.c.point_uuid == device_points.c.uuid) \
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3373, in all
return list(self)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3535, in __iter__
return self._execute_and_instances(context)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3560, in _execute_and_instances
result = conn.execute(querycontext.statement, self._params)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1011, in execute
return meth(self, multiparams, params)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/sql/elements.py", line 298, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1130, in _execute_clauseelement
distilled_params,
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1317, in _execute_context
e, statement, parameters, cursor, context
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1511, in _handle_dbapi_exception
sqlalchemy_exception, with_traceback=exc_info[2], from_=e
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
raise exception
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1277, in _execute_context
cursor, statement, parameters, context
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 593, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) database is locked
[SQL: SELECT anon_1.uuid AS anon_1_uuid, anon_1.name AS anon_1_name, anon_1.reg AS anon_1_reg, anon_2.value AS anon_2_value, anon_2.fault AS anon_2_fault
FROM (SELECT mod_points.uuid AS uuid, mod_points.name AS name, mod_points.reg AS reg, mod_points.reg_length AS reg_length, mod_points.type AS type, mod_points.enable AS enable, mod_points.write_value A_type AS data_type, mod_points.data_endian AS data_endian, mod_points.data_round AS data_round, mod_points.data_offset AS data_offset, mod_points.timeout AS timeout, mod_points.timeout_global AS timeouuplicates AS prevent_duplicates, mod_points.prevent_duplicates_global AS prevent_duplicates_global, mod_points.created_on AS created_on, mod_points.updated_on AS updated_on, mod_points.device_uuid AS d
FROM mod_points
WHERE mod_points.device_uuid = ?) AS anon_1 JOIN (SELECT anon_3.id AS id, anon_3.value AS value, anon_3.value_array AS value_array, anon_3.fault AS fault, anon_3.fault_message AS fault_message, anon_3. point_uuid, anon_3.rank AS rank
FROM (SELECT mod_points_store.id AS id, mod_points_store.value AS value, mod_points_store.value_array AS value_array, mod_points_store.fault AS fault, mod_points_store.fault_message AS fault_message, mpoints_store.point_uuid AS point_uuid, rank() OVER (PARTITION BY mod_points_store.point_uuid ORDER BY mod_points_store.ts DESC) AS rank
FROM mod_points_store) AS anon_3
WHERE anon_3.rank = ?) AS anon_2 ON anon_2.point_uuid = anon_1.uuid]
[parameters: ('a085510c-2c07-4598-8711-be438836dfbb', 1)]
(Background on this error at: http://sqlalche.me/e/13/e3q8)
127.0.0.1 - - [25/Oct/2020 00:24:29] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 500 -
127.0.0.1 - - [25/Oct/2020 00:24:29] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 500 -
Traceback (most recent call last):
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1277, in _execute_context
cursor, statement, parameters, context
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 593, in do_execute
cursor.execute(statement, parameters)
sqlite3.OperationalError: database is locked
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 2464, in __call__
return self.wsgi_app(environ, start_response)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 2450, in wsgi_app
response = self.handle_exception(e)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 272, in error_router
return original_handler(e)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_cors/extension.py", line 165, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 1867, in handle_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/_compat.py", line 38, in reraise
raise value.with_traceback(tb)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 272, in error_router
return original_handler(e)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_cors/extension.py", line 165, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/_compat.py", line 38, in reraise
raise value.with_traceback(tb)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 468, in wrapper
resp = resource(*args, **kwargs)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/views.py", line 89, in view
return self.dispatch_request(*args, **kwargs)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 583, in dispatch_request
resp = meth(*args, **kwargs)
File "/home/pi/bac-rest/src/modbus/resources/point/point_plural.py", line 57, in get
.join(filtered_partition_table, filtered_partition_table.c.point_uuid == device_points.c.uuid) \
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3373, in all
return list(self)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3535, in __iter__
return self._execute_and_instances(context)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3560, in _execute_and_instances
result = conn.execute(querycontext.statement, self._params)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1011, in execute
return meth(self, multiparams, params)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/sql/elements.py", line 298, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1130, in _execute_clauseelement
distilled_params,
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1317, in _execute_context
e, statement, parameters, cursor, context
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1511, in _handle_dbapi_exception
sqlalchemy_exception, with_traceback=exc_info[2], from_=e
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
raise exception
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1277, in _execute_context
cursor, statement, parameters, context
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 593, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) database is locked
[SQL: SELECT anon_1.uuid AS anon_1_uuid, anon_1.name AS anon_1_name, anon_1.reg AS anon_1_reg, anon_2.value AS anon_2_value, anon_2.fault AS anon_2_fault
FROM (SELECT mod_points.uuid AS uuid, mod_points.name AS name, mod_points.reg AS reg, mod_points.reg_length AS reg_length, mod_points.type AS type, mod_points.enable AS enable, mod_points.write_value A_type AS data_type, mod_points.data_endian AS data_endian, mod_points.data_round AS data_round, mod_points.data_offset AS data_offset, mod_points.timeout AS timeout, mod_points.timeout_global AS timeouuplicates AS prevent_duplicates, mod_points.prevent_duplicates_global AS prevent_duplicates_global, mod_points.created_on AS created_on, mod_points.updated_on AS updated_on, mod_points.device_uuid AS d
FROM mod_points
WHERE mod_points.device_uuid = ?) AS anon_1 JOIN (SELECT anon_3.id AS id, anon_3.value AS value, anon_3.value_array AS value_array, anon_3.fault AS fault, anon_3.fault_message AS fault_message, anon_3. point_uuid, anon_3.rank AS rank
FROM (SELECT mod_points_store.id AS id, mod_points_store.value AS value, mod_points_store.value_array AS value_array, mod_points_store.fault AS fault, mod_points_store.fault_message AS fault_message, mpoints_store.point_uuid AS point_uuid, rank() OVER (PARTITION BY mod_points_store.point_uuid ORDER BY mod_points_store.ts DESC) AS rank
FROM mod_points_store) AS anon_3
WHERE anon_3.rank = ?) AS anon_2 ON anon_2.point_uuid = anon_1.uuid]
[parameters: ('a085510c-2c07-4598-8711-be438836dfbb', 1)]
(Background on this error at: http://sqlalche.me/e/13/e3q8)
127.0.0.1 - - [25/Oct/2020 00:24:29] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 500 -
Traceback (most recent call last):
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1277, in _execute_context
cursor, statement, parameters, context
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 593, in do_execute
cursor.execute(statement, parameters)
sqlite3.OperationalError: database is locked
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 2464, in __call__
return self.wsgi_app(environ, start_response)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 2450, in wsgi_app
response = self.handle_exception(e)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 272, in error_router
return original_handler(e)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_cors/extension.py", line 165, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 1867, in handle_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/_compat.py", line 38, in reraise
raise value.with_traceback(tb)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 272, in error_router
return original_handler(e)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_cors/extension.py", line 165, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/_compat.py", line 38, in reraise
raise value.with_traceback(tb)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 468, in wrapper
resp = resource(*args, **kwargs)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/views.py", line 89, in view
return self.dispatch_request(*args, **kwargs)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 583, in dispatch_request
resp = meth(*args, **kwargs)
File "/home/pi/bac-rest/src/modbus/resources/point/point_plural.py", line 57, in get
.join(filtered_partition_table, filtered_partition_table.c.point_uuid == device_points.c.uuid) \
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3373, in all
return list(self)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3535, in __iter__
return self._execute_and_instances(context)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3560, in _execute_and_instances
result = conn.execute(querycontext.statement, self._params)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1011, in execute
return meth(self, multiparams, params)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/sql/elements.py", line 298, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1130, in _execute_clauseelement
distilled_params,
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1317, in _execute_context
e, statement, parameters, cursor, context
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1511, in _handle_dbapi_exception
sqlalchemy_exception, with_traceback=exc_info[2], from_=e
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
raise exception
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1277, in _execute_context
cursor, statement, parameters, context
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 593, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) database is locked
[SQL: SELECT anon_1.uuid AS anon_1_uuid, anon_1.name AS anon_1_name, anon_1.reg AS anon_1_reg, anon_2.value AS anon_2_value, anon_2.fault AS anon_2_fault
FROM (SELECT mod_points.uuid AS uuid, mod_points.name AS name, mod_points.reg AS reg, mod_points.reg_length AS reg_length, mod_points.type AS type, mod_points.enable AS enable, mod_points.write_value A_type AS data_type, mod_points.data_endian AS data_endian, mod_points.data_round AS data_round, mod_points.data_offset AS data_offset, mod_points.timeout AS timeout, mod_points.timeout_global AS timeouuplicates AS prevent_duplicates, mod_points.prevent_duplicates_global AS prevent_duplicates_global, mod_points.created_on AS created_on, mod_points.updated_on AS updated_on, mod_points.device_uuid AS d
FROM mod_points
WHERE mod_points.device_uuid = ?) AS anon_1 JOIN (SELECT anon_3.id AS id, anon_3.value AS value, anon_3.value_array AS value_array, anon_3.fault AS fault, anon_3.fault_message AS fault_message, anon_3. point_uuid, anon_3.rank AS rank
FROM (SELECT mod_points_store.id AS id, mod_points_store.value AS value, mod_points_store.value_array AS value_array, mod_points_store.fault AS fault, mod_points_store.fault_message AS fault_message, mpoints_store.point_uuid AS point_uuid, rank() OVER (PARTITION BY mod_points_store.point_uuid ORDER BY mod_points_store.ts DESC) AS rank
FROM mod_points_store) AS anon_3
WHERE anon_3.rank = ?) AS anon_2 ON anon_2.point_uuid = anon_1.uuid]
[parameters: ('a085510c-2c07-4598-8711-be438836dfbb', 1)]
(Background on this error at: http://sqlalche.me/e/13/e3q8)
Traceback (most recent call last):
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1277, in _execute_context
cursor, statement, parameters, context
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 593, in do_execute
cursor.execute(statement, parameters)
sqlite3.OperationalError: database is locked
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 2464, in __call__
return self.wsgi_app(environ, start_response)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 2450, in wsgi_app
response = self.handle_exception(e)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 272, in error_router
return original_handler(e)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_cors/extension.py", line 165, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 1867, in handle_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/_compat.py", line 38, in reraise
raise value.with_traceback(tb)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 272, in error_router
return original_handler(e)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_cors/extension.py", line 165, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/_compat.py", line 38, in reraise
raise value.with_traceback(tb)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 468, in wrapper
resp = resource(*args, **kwargs)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/views.py", line 89, in view
return self.dispatch_request(*args, **kwargs)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 583, in dispatch_request
resp = meth(*args, **kwargs)
File "/home/pi/bac-rest/src/modbus/resources/point/point_plural.py", line 57, in get
.join(filtered_partition_table, filtered_partition_table.c.point_uuid == device_points.c.uuid) \
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3373, in all
return list(self)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3535, in __iter__
return self._execute_and_instances(context)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3560, in _execute_and_instances
result = conn.execute(querycontext.statement, self._params)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1011, in execute
return meth(self, multiparams, params)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/sql/elements.py", line 298, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1130, in _execute_clauseelement
distilled_params,
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1317, in _execute_context
e, statement, parameters, cursor, context
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1511, in _handle_dbapi_exception
sqlalchemy_exception, with_traceback=exc_info[2], from_=e
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
raise exception
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1277, in _execute_context
cursor, statement, parameters, context
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 593, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) database is locked
[SQL: SELECT anon_1.uuid AS anon_1_uuid, anon_1.name AS anon_1_name, anon_1.reg AS anon_1_reg, anon_2.value AS anon_2_value, anon_2.fault AS anon_2_fault
FROM (SELECT mod_points.uuid AS uuid, mod_points.name AS name, mod_points.reg AS reg, mod_points.reg_length AS reg_length, mod_points.type AS type, mod_points.enable AS enable, mod_points.write_value A_type AS data_type, mod_points.data_endian AS data_endian, mod_points.data_round AS data_round, mod_points.data_offset AS data_offset, mod_points.timeout AS timeout, mod_points.timeout_global AS timeouuplicates AS prevent_duplicates, mod_points.prevent_duplicates_global AS prevent_duplicates_global, mod_points.created_on AS created_on, mod_points.updated_on AS updated_on, mod_points.device_uuid AS d
FROM mod_points
WHERE mod_points.device_uuid = ?) AS anon_1 JOIN (SELECT anon_3.id AS id, anon_3.value AS value, anon_3.value_array AS value_array, anon_3.fault AS fault, anon_3.fault_message AS fault_message, anon_3. point_uuid, anon_3.rank AS rank
FROM (SELECT mod_points_store.id AS id, mod_points_store.value AS value, mod_points_store.value_array AS value_array, mod_points_store.fault AS fault, mod_points_store.fault_message AS fault_message, mpoints_store.point_uuid AS point_uuid, rank() OVER (PARTITION BY mod_points_store.point_uuid ORDER BY mod_points_store.ts DESC) AS rank
FROM mod_points_store) AS anon_3
WHERE anon_3.rank = ?) AS anon_2 ON anon_2.point_uuid = anon_1.uuid]
[parameters: ('a085510c-2c07-4598-8711-be438836dfbb', 1)]
(Background on this error at: http://sqlalche.me/e/13/e3q8)
127.0.0.1 - - [25/Oct/2020 00:24:29] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 500 -
Traceback (most recent call last):
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 2464, in __call__
return self.wsgi_app(environ, start_response)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 2450, in wsgi_app
response = self.handle_exception(e)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 272, in error_router
return original_handler(e)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_cors/extension.py", line 165, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 1867, in handle_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/_compat.py", line 38, in reraise
raise value.with_traceback(tb)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 272, in error_router
return original_handler(e)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_cors/extension.py", line 165, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/_compat.py", line 38, in reraise
raise value.with_traceback(tb)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 468, in wrapper
resp = resource(*args, **kwargs)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/views.py", line 89, in view
return self.dispatch_request(*args, **kwargs)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 583, in dispatch_request
resp = meth(*args, **kwargs)
File "/home/pi/bac-rest/src/modbus/resources/point/point_plural.py", line 57, in get
.join(filtered_partition_table, filtered_partition_table.c.point_uuid == device_points.c.uuid) \
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3373, in all
return list(self)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3535, in __iter__
return self._execute_and_instances(context)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3557, in _execute_and_instances
querycontext, self._connection_from_session, close_with_result=True
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3572, in _get_bind_args
mapper=self._bind_mapper(), clause=querycontext.statement, **kw
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3550, in _connection_from_session
conn = self.session.connection(**kw)
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/orm/session.py", line 1141, in connection
execution_options=execution_options,
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/orm/session.py", line 1147, in _connection_for_bind
engine, execution_options
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/orm/session.py", line 409, in _connection_for_bind
self._assert_active()
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/orm/session.py", line 283, in _assert_active
"This session is in 'prepared' state; no further "
sqlalchemy.exc.InvalidRequestError: This session is in 'prepared' state; no further SQL can be emitted within this transaction.
127.0.0.1 - - [25/Oct/2020 00:24:30] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 500 -
127.0.0.1 - - [25/Oct/2020 00:24:30] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 500 -
127.0.0.1 - - [25/Oct/2020 00:24:30] "GET /api/modbus/a085510c-2c07-4598-8711-be438836dfbb/points_store HTTP/1.1" 500 -
Traceback (most recent call last):
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1277, in _execute_context
cursor, statement, parameters, context
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 593, in do_execute
cursor.execute(statement, parameters)
sqlite3.OperationalError: database is locked
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/pi/bac-rest/venv/lib/python3.7/site-packages/flask/app.py", line 2464, in __call__
Schema update conflicts (Bug when using)
[SQL: SELECT points.uuid AS points_uuid, points.name AS points_name, points.device_uuid AS points_device_uuid, points.enable AS points_enable, points.history_enable AS points_history_enable, points.history_type AS points_history_type, points.history_interval AS points_history_interval, points.cov_threshold AS points_cov_threshold, points.writable AS points_writable, points.write_value AS points_write_value, points.driver AS points_driver, points.created_on AS points_created_on, points.updated_on AS points_updated_on, point_stores_1.point_uuid AS point_stores_1_point_uuid, point_stores_1.value AS point_stores_1_value, point_stores_1.value_array AS point_stores_1_value_array, point_stores_1.fault AS point_stores_1_fault, point_stores_1.fault_message AS point_stores_1_fault_message, point_stores_1.ts AS point_stores_1_ts
FROM points LEFT OUTER JOIN point_stores AS point_stores_1 ON points.uuid = point_stores_1.point_uuid
WHERE ? = points.device_uuid]
[parameters: ('ce7b5f4b-79dc-48dc-b74e-d44e9e1453f9',)]
(Background on this error at: http://sqlalche.me/e/13/e3q8)
2020-11-30 19:34:53,079 INFO: werkzeug> 49.180.47.223 - - [30/Nov/2020 19:34:53] "GET /api/modbus/networks HTTP/1.1" 500 -
Traceback (most recent call last):
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1277, in _execute_context
cursor, statement, parameters, context
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 593, in do_execute
cursor.execute(statement, parameters)
sqlite3.OperationalError: no such column: points.cov_threshold
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/flask/app.py", line 2464, in __call__
return self.wsgi_app(environ, start_response)
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/flask/app.py", line 2450, in wsgi_app
response = self.handle_exception(e)
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 272, in error_router
return original_handler(e)
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/flask_cors/extension.py", line 165, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/flask/app.py", line 1867, in handle_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/flask/_compat.py", line 38, in reraise
raise value.with_traceback(tb)
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 272, in error_router
return original_handler(e)
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/flask_cors/extension.py", line 165, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/flask/_compat.py", line 38, in reraise
raise value.with_traceback(tb)
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 468, in wrapper
resp = resource(*args, **kwargs)
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/flask/views.py", line 89, in view
return self.dispatch_request(*args, **kwargs)
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 583, in dispatch_request
resp = meth(*args, **kwargs)
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 680, in wrapper
return marshal(resp, self.fields, self.envelope)
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 631, in marshal
if envelope else [marshal(d, fields) for d in data])
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 630, in <listcomp>
return (OrderedDict([(envelope, [marshal(d, fields) for d in data])])
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 636, in marshal
return OrderedDict([(envelope, OrderedDict(items))]) if envelope else OrderedDict(items)
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 635, in <genexpr>
for k, v in fields.items())
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/flask_restful/fields.py", line 200, in output
return self.format(value)
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/flask_restful/fields.py", line 193, in format
for idx, val in enumerate(value)
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/flask_restful/fields.py", line 193, in <listcomp>
for idx, val in enumerate(value)
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/flask_restful/fields.py", line 155, in output
return marshal(value, self.nested)
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 636, in marshal
return OrderedDict([(envelope, OrderedDict(items))]) if envelope else OrderedDict(items)
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 635, in <genexpr>
for k, v in fields.items())
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/flask_restful/fields.py", line 197, in output
value = get_value(key if self.attribute is None else self.attribute, data)
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/flask_restful/fields.py", line 43, in get_value
return _get_value_for_keys(key.split('.'), obj, default)
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/flask_restful/fields.py", line 48, in _get_value_for_keys
return _get_value_for_key(keys[0], obj, default)
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/flask_restful/fields.py", line 60, in _get_value_for_key
return getattr(obj, key, default)
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/sqlalchemy/orm/attributes.py", line 287, in __get__
return self.impl.get(instance_state(instance), dict_)
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/sqlalchemy/orm/attributes.py", line 723, in get
value = self.callable_(state, passive)
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/sqlalchemy/orm/strategies.py", line 760, in _load_for_state
session, state, primary_key_identity, passive
File "<string>", line 1, in <lambda>
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/sqlalchemy/orm/strategies.py", line 902, in _emit_lazyload
.with_post_criteria(set_default_params)
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/sqlalchemy/ext/baked.py", line 544, in all
return list(self)
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/sqlalchemy/ext/baked.py", line 444, in __iter__
return q._execute_and_instances(context)
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3560, in _execute_and_instances
result = conn.execute(querycontext.statement, self._params)
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1011, in execute
return meth(self, multiparams, params)
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/sqlalchemy/sql/elements.py", line 298, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1130, in _execute_clauseelement
distilled_params,
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1317, in _execute_context
e, statement, parameters, cursor, context
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1511, in _handle_dbapi_exception
sqlalchemy_exception, with_traceback=exc_info[2], from_=e
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
raise exception
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1277, in _execute_context
cursor, statement, parameters, context
File "/home/pi/common-py-libs/venv/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 593, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such column: points.cov_threshold
[SQL: SELECT points.uuid AS points_uuid, points.name AS points_name, points.device_uuid AS points_device_uuid, points.enable AS points_enable, points.history_enable AS points_history_enable, points.history_type AS points_history_type, points.history_interval AS points_history_interval, points.cov_threshold AS points_cov_threshold, points.writable AS points_writable, points.write_value AS points_write_value, points.driver AS points_driver, points.created_on AS points_created_on, points.updated_on AS points_updated_on, point_stores_1.point_uuid AS point_stores_1_point_uuid, point_stores_1.value AS point_stores_1_value, point_stores_1.value_array AS point_stores_1_value_array, point_stores_1.fault AS point_stores_1_fault, point_stores_1.fault_message AS point_stores_1_fault_message, point_stores_1.ts AS point_stores_1_ts
FROM points LEFT OUTER JOIN point_stores AS point_stores_1 ON points.uuid = point_stores_1.point_uuid
WHERE ? = points.device_uuid]
[parameters: ('ce7b5f4b-79dc-48dc-b74e-d44e9e1453f9',)]
(Background on this error at: http://sqlalche.me/e/13/e3q8)
Password JWT
Needs to be done for
- bac-rest
- https://github.com/NubeDev/bacnet-flask
- https://github.com/NubeIO/bbb-py-rest
- https://github.com/NubeDev/s-mon
JWT
I found this one to be the best
https://flask-jwt-extended.readthedocs.io/en/stable/basic_usage/
Storing password
keyring
https://pypi.org/project/keyring/
bcrypt
Don't publish on PATCH when nothing changed
2020-12-17 20:50:06,595 INFO: werkzeug> 127.0.0.1 - - [17/Dec/2020 20:50:06] "PATCH /api/generic/points/70e0a228-e442-46ba-8d2b-d71e52089b78 HTTP/1.1" 200 -
2020-12-17 20:50:20,713 ERROR: src> Exception on /api/generic/points/70e0a228-e442-46ba-8d2b-d71e52089b78 [PATCH]
Traceback (most recent call last):
File "/home/aidan/code/py-nube/rubix-point-server/src/source_drivers/generic/resources/point/point_singular.py", line 48, in patch
return point.update(**data)
File "/home/aidan/code/py-nube/rubix-point-server/src/models/point/model_point.py", line 91, in update
super().update(**kwargs)
File "/home/aidan/code/py-nube/rubix-point-server/src/models/model_base.py", line 51, in update
EventDispatcher.dispatch_from_service(None, event, None)
File "/home/aidan/code/py-nube/rubix-point-server/src/event_dispatcher.py", line 45, in dispatch_from_service
service.add_event(event)
File "/home/aidan/code/py-nube/rubix-point-server/src/services/event_service_base.py", line 72, in add_event
self._run_event(event)
File "/home/aidan/code/py-nube/rubix-point-server/src/services/mqtt_client/mqtt_client.py", line 123, in _run_event
self.publish_update(event.data.get('model'), event.data.get('updates'))
File "/home/aidan/code/py-nube/rubix-point-server/src/services/mqtt_client/mqtt_client.py", line 83, in publish_update
raise Exception('Invalid MQTT publish arguments')
Exception: Invalid MQTT publish arguments
During handling of the above exception, another exception occurred:
Modbus Device Poll Endpoint
Allow endpoint to poll device
this will use the CALLABLE
event to send the request from flash thread to modbus thread (there's an example commented out in the code already on how to do this)
- request by
DEVICE
uuid
/name
/address
andPOINT
uuid
/name
/register
Polling stops if no client is connected
If polling for a network is set to True
needs to keep trying to reconnect forever
change endpoints to not return children
make /networks
and /devices
not return all their children
maybe change current design to a different endpoint
Modbus point fault and fault messages
Store the modbus error code
point_store table
When we save a new modbus read we are string in the point_store
table
The issue is this will get full very fast. So we need a roll over or limit on max size
fix CORS
“Access-Control-Allow-Origin’
Non urgent
Get math function working on point
gunicorn issue
Values dont seem to update in point store when systemd is set to
ExecStart=/home/pi/bac-rest/venv/bin/gunicorn -b 0.0.0.0:1515 --log-level=DEBUG -w 1 run:app
Works fine like this
ExecStart=/home/pi/bac-rest/venv/bin/python run.py
Add polling stats
We need some polling status that are avalible from an API call.
These can be reset on start of the app and dont need to be stored in the DB
For example
- start time of first poll
- start time & finish of current poll and time taken to complete a loop time of all devices and points
- Poll loop count
- Poll fails/success for points
Error on endpoint /api/system/ping
File "/home/thuan/workspace/bac-rest/venv/lib/python3.8/site-packages/flask/app.py", line 2464, in __call__
return self.wsgi_app(environ, start_response)
File "/home/thuan/workspace/bac-rest/venv/lib/python3.8/site-packages/flask/app.py", line 2450, in wsgi_app
response = self.handle_exception(e)
File "/home/thuan/workspace/bac-rest/venv/lib/python3.8/site-packages/flask_restful/__init__.py", line 272, in error_router
return original_handler(e)
File "/home/thuan/workspace/bac-rest/venv/lib/python3.8/site-packages/flask_cors/extension.py", line 165, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/home/thuan/workspace/bac-rest/venv/lib/python3.8/site-packages/flask/app.py", line 1867, in handle_exception
reraise(exc_type, exc_value, tb)
File "/home/thuan/workspace/bac-rest/venv/lib/python3.8/site-packages/flask/_compat.py", line 38, in reraise
raise value.with_traceback(tb)
File "/home/thuan/workspace/bac-rest/venv/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/thuan/workspace/bac-rest/venv/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/thuan/workspace/bac-rest/venv/lib/python3.8/site-packages/flask_restful/__init__.py", line 272, in error_router
return original_handler(e)
File "/home/thuan/workspace/bac-rest/venv/lib/python3.8/site-packages/flask_cors/extension.py", line 165, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/home/thuan/workspace/bac-rest/venv/lib/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/thuan/workspace/bac-rest/venv/lib/python3.8/site-packages/flask/_compat.py", line 38, in reraise
raise value.with_traceback(tb)
File "/home/thuan/workspace/bac-rest/venv/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/thuan/workspace/bac-rest/venv/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/home/thuan/workspace/bac-rest/venv/lib/python3.8/site-packages/flask_restful/__init__.py", line 468, in wrapper
resp = resource(*args, **kwargs)
File "/home/thuan/workspace/bac-rest/venv/lib/python3.8/site-packages/flask/views.py", line 89, in view
return self.dispatch_request(*args, **kwargs)
File "/home/thuan/workspace/bac-rest/venv/lib/python3.8/site-packages/flask_restful/__init__.py", line 583, in dispatch_request
resp = meth(*args, **kwargs)
File "/home/thuan/workspace/bac-rest/src/system/resources/ping.py", line 34, in get
'mqtt_client_status': MqttClient.get_instance().status(),
AttributeError: type object 'MqttClient' has no attribute 'get_instance'
Add console logger
- Remove existing stdout prints &
- Add console logger which should able to filter in logs according to the level of logger settings
gunicorn doesn't run the DB
seems like gunicorn doesn't run anything with the DB
no driver polling updates and no DB table initialisation if haven't ran manually already (python run.py
)
Disable if not enabled
Modbus, Please disable from polling
mod_network_enable
mod_device_enable
mod_point_enable
DB unique fields
Please make
network
- RTU comm port unique
device
- modbus RTU address needs to be unique
per network
- modbus IP address needs to be unique
per network
point
- modbus RTU point address needs to be unique
per function type
Possible influx bug when not enabled
checked on an install and seen it tried to connect to influx when it wasn't enabled
Dec 08 08:35:01 raspberrypi point-server[17975]: 2020-12-08 08:35:01,765 ERROR: src.services.histories.sync.influxdb> Connection Error: HTTPConnectionPool(host='0.0.0.0', port=8086): Max retries exceeded with url: /ping (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x73c1fd50>: Failed to establish a new connection: [Errno 111] Connection refused'))
config:
[settings]
enable_mqtt = true
enable_tcp = true
enable_rtu = false
enable_histories = false
enable_cleaner = false
enable_history_sync = false
...
[influx_db]
host = 0.0.0.0
port = 8086
database = db
username = username
password = password
verify_ssl = false
timeout = 5
retries = 3
timer = 1
measurement = history
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.