Open asmodehn opened 5 years ago
My server timezone is CEST, maybe that is related somehow ?
Hmm, this same message appears as a warning on other installs of gryphon, but not an exception. My guess is that different database drivers have different behaviour. Do you know what mysql version you are on?
The issue has to do with details about how mysql stores and retrieves datetime values. I believe the string '2019-07-04 15:48:46+00:00' should actually be going into the database without the timezone information in it (the part after the plus sign). Gryphon operates only in UTC so we don't actually need to be storing timezone data anyway. You can see someone with a similar issue here: https://dba.stackexchange.com/questions/48704/mysql-5-6-datetime-incorrect-datetime-value-2013-08-25t1700000000-with-er
Here's an idea to test. Trades are created in the accounting system here: https://github.com/garethdmm/gryphon/blob/8963d079e432b886d571efc085181a8ce3b0b39f/gryphon/lib/models/order.pyx#L93-L104
I think that last line is causing the issue because it's creating a timezone-aware datetime. Try replacing it with this:
new_trade.time_created = epoch(trade['time']).datetime.replace(tzinfo=None)
There's probably a more elegant way to do this but this should explicitly strip the timezone information from the datetime object.
alexv@pop-os:~$ mysql --version
mysql Ver 15.1 Distrib 10.3.13-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
alexv@pop-os:~$ mariadb --version
mariadb Ver 15.1 Distrib 10.3.13-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
That change seems to have fixed the issue as I could do a trade, and i believe it was registered as expected...
This probably needs a more thorough investigation though, as my dashboard is not super clean, and I am not yet familiar enough with gryphon to be able to spot other places where things don't work as expected...
I had the same issue.
matteo@matteo-pi:~$ mysql --version mysql Ver 14.14 Distrib 5.7.26, for Linux (armv7l) using EditLine wrapper
Gareth's change seems to have fixed the issue
I started trading on kraken recently and I got this (on first order passed I think...) :
Any hint ?