-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No sessions being displayed #10
Comments
Do you have anything in your mysql logs? That error indicates it couldn't fetch any sessions; since the data is there I'm wondering if something isn't wonky with the retrieval of sessions in the get_sessions.php file. I haven't changed anything in forever, but it's possible if malformed data got in there it could mess up the query, or it could be an input-santiization bug. |
Hmm, I see one log from yesterday when I drove home, but none of my other logs. Here's all I see in the SQL logs;
If I execute the first query (highlighted in bold), I get two sessions. One with session size 74 and the other as 4. If I execute the second query, I get a result of the torque_keys Id, description and type. If I execute the third query, I get a result of two torque_keys - kff1005 & kff1006 with data. If I execute the fourth query, I just get the current year.. 2016 And the fifth query just shows me the profile name I saved in Torque for my car. Looking in the sessions table in MySQL, I can see there are 8 sessions in total. These are my lost sessions that aren't being displayed on the web interface. EDIT: It turns out I can see all my sessions again. What the hell? |
UGGGHHHHH I forgot about this and thought I solved it, and it's been so long since looking at the code I forgot. At the first of the month the default filter applies to an empty set (it says "check October of this year for sessions") and that stops subsequent queries...you added an October session, now the script continues. I thought I patched that by doing a "pull the last 2 months" code...I'll review. |
Heheh, glad you remembered! Will you let me know when I can update from the repo with the fixes? |
I have a similar problem. Since January 01 2017 no session are being displayed. I got no error or something else. I also cant select the year 2016. If I look in the database, there are the entries from 2016. I use the code from the last commit 9e61be8. I found a PHP Warning in apache-log: Update: |
I need to take another look at the condition where it deals with finding an empty set. If I can get some code time tonight while I'm looking at #12 I'll see if I can handle it better. I still think the core issue is the rolling over of the default set when a new month comes around...I may have solved the "new month" condition, but not the "new year" condition. |
The same error with current commit - no sessions. In mysql log I see only two requests: 2017-01-08T17:35:15.829271Z 240 Query SELECT timestart, timeend, session, profileName, sessionsize FROM sessions WHERE ( YEAR(FROM_UNIXTIME(session/1000)) LIKE '2017' AND MONTHNAME(FROM_UNIXTIME(session/1000)) LIKE 'January' ) GROUP BY session, profileName, timestart, timeend, sessionsize ORDER BY session DESC 2017-01-08T17:35:15.832585Z 240 Query SELECT id,description,type FROM torque_keys WHERE populated = 1 ORDER BY description When I repeat first query in MYSQL I get 8 sessions. Second query returns torque keys. And in webserver logs I see the same error as mentioned above: |
It is working now. My problem was, that there were no logs sent to the server. The bluetooth-adapter had no connection to the ECU. Replugged in and all fine. Now, I have the first logs in 2017 and the sessions, also from 2016, are displayed. Sorry for my english. |
@marvinwankersteen glad to hear it! @adel-s Do me a favor, in the mysql console, run the following (correct your DB name of course) Then paste the results please. |
mysql> SELECT session, YEAR(FROM_UNIXTIME(session/1000)) as year, MONTHNAME(FROM_UNIXTIME(session/1000)) as month from raw_logs ORDER BY session DESC LIMIT 20; mysql> SELECT session, YEAR(FROM_UNIXTIME(session/1000)) as year, MONTHNAME(FROM_UNIXTIME(session/1000)) as month from sessions ORDER BY session DESC LIMIT 20; But after some debug today I found why this happened - all my sessions has $row["sessionsize"] less than 20. That's why I see no sessions. Sorry my bad. |
Oh, ok cool, glad it's working! |
The data is there and I could see all my sessions previously. Checked just now and it's not displaying any sessions even though the data exists in the database.
Current php warnings;
[Sat Oct 01 19:19:39.098668 2016] [:error] [pid 27773] [client 192.168.0.103:55266] PHP Warning: max(): When only one parameter is given, it must be an array in /var/www/TorqueLog/session.php on line 15, referer: http://192.168.0.138:81/TorqueLog/session.php
[Sat Oct 01 19:19:39.098848 2016] [:error] [pid 27773] [client 192.168.0.103:55266] PHP Notice: Undefined variable: session_id in /var/www/TorqueLog/session.php on line 321, referer: http://192.168.0.138:81/TorqueLog/session.php
[Sat Oct 01 19:19:39.099957 2016] [:error] [pid 27773] [client 192.168.0.103:55266] PHP Notice: Undefined variable: session_id in /var/www/TorqueLog/session.php on line 535, referer: http://192.168.0.138:81/TorqueLog/session.php
Running on Raspberry Pi 3 with Apache2 & PHP 5.6.24-0+deb8u1 (cli)
The text was updated successfully, but these errors were encountered: