FlyingDiver / Indigo-miniUniFi

Minimalistic UniFi plugin for Indigo
MIT License
0 stars 0 forks source link

SQL Logger error as reported on the Indigo forum #24

Closed autolog closed 3 years ago

autolog commented 3 years ago

I think I have discovered the issue - it looks like it might be a problem with the SQL Logger.

The fields causing the problem are e.g. :

Using Valentina Studio to interrogate the indigo device schema schema for the device, the field types for these fields are defined as integer which can hold a maxim value of -2147483648 to +2147483647. Those values listed above are larger.

The fields need to be of type bigint which can hold -9223372036854775808 to 9223372036854775807.

Either that or your plugin needs to store them as strings.

I will try and do a fix by changing the filed types to bigint and see what happens. :)

FlyingDiver commented 3 years ago

Well, the plugin's not going to change the type. I do an automatic state generation based on the JSON dict returned by the controller. If the value in the dict is an int or float, it's going to be a Number type in the state. Adding exceptions for specific fields isn't really practical.

FlyingDiver commented 3 years ago

I wonder if there's a way to reset that counter on a regular basis?

autolog commented 3 years ago

I probably wouldn't want to do that - this looks like an SQL Logger issue.

autolog commented 3 years ago

Changing it to bigint doesn't seem to resolve the issue, so while that might be a solution, it probably requires the SQL Logger to be fixed. Also it looks like I would have to change at least 16 fields (RX & TX) for my 8 port device. If users have 24 or 48 port devices then that would be a headache. Also, if you ever deleted the device, you would have to do all that work again - so not really practical. At the moment, I have temporarily had to disable the plugin as it is filling my log with pages of sql logger error messages. I am getting a screen full for every error as it lists out all the states.

FlyingDiver commented 3 years ago

And those are coming from the SQL Logger, so nothing I can do to suppress them.

autolog commented 3 years ago

Correct, I think.

It is the SQL logger trying to insert a record and updating an int field with too big a value (for an int field).

Probably one to fire at Matt. Do you want to do it or should I?

FlyingDiver commented 3 years ago

I can't replicate it, so you should.

autolog commented 3 years ago

OK :)

autolog commented 3 years ago

Posted here: https://forums.indigodomo.com/viewtopic.php?f=98&t=24502