econpy / torque

A set of tools used with the Torque app for Android to store OBD2 data in MySQL, view GPS data from Torque on a map in real time using the Google Maps JavaScript API, plot OBD2 data in time series charts, and export the data to CSV or JSON.
MIT License
285 stars 120 forks source link

Not displaying data #12

Closed mo5245 closed 9 years ago

mo5245 commented 10 years ago

Unsure if missed a step or something, folder is 755, see data in mysql, load ../session.php see date and time under Select Session, but after selecting it just reloads page. dose it need any php settings or add on needed?

econpy commented 10 years ago

Check your Apache error log and see what it's saying (on Linux/Ubuntu usually /var/log/apache2/error.log).

mo5245 commented 10 years ago

PHP Warning: Invalid argument supplied for foreach() in /session.php on line 208 PHP Warning: Invalid argument supplied for foreach() in /session.php on line 209 PHP Warning: Invalid argument supplied for foreach() in /session.php on line 301

From php error log, waiting on hosting provider to get Apache log, is running PHP 5.3.13

with ini_set('error_reporting', -1);

PHP Notice: Undefined variable: coldata in /get_columns.php on line 24 PHP Notice: Undefined variable: d1 in /session.php on line 209 PHP Warning: Invalid argument supplied for foreach() in /session.php on line 209 PHP Notice: Undefined variable: d2 in /session.php on line 210 PHP Warning: Invalid argument supplied for foreach() in /session.php on line 210 PHP Notice: Undefined variable: v1_label in /session.php on line 213 PHP Notice: Undefined variable: v2_label in /session.php on line 214 PHP Notice: Undefined variable: v1_label in /session.php on line 226 PHP Notice: Undefined variable: v2_label in /session.php on line 229 PHP Notice: Undefined variable: coldata in /session.php on line 302 PHP Warning: Invalid argument supplied for foreach() in /session.php on line 302 PHP Notice: Undefined variable: v1_label in /session.php on line 350 PHP Notice: Undefined variable: min1 in /session.php on line 351 PHP Notice: Undefined variable: max1 in /session.php on line 351 PHP Notice: Undefined variable: pcnt25data1 in /session.php on line 352 PHP Notice: Undefined variable: pcnt75data1 in /session.php on line 353 PHP Notice: Undefined variable: avg1 in /session.php on line 354 PHP Notice: Undefined variable: sparkdata1 in /session.php on line 355 PHP Notice: Undefined variable: v2_label in /session.php on line 358 PHP Notice: Undefined variable: min2 in /session.php on line 359 PHP Notice: Undefined variable: max2 in /session.php on line 359 PHP Notice: Undefined variable: pcnt25data2 in /session.php on line 360 PHP Notice: Undefined variable: pcnt75data2 in /session.php on line 361 PHP Notice: Undefined variable: avg2 in /session.php on line 362 PHP Notice: Undefined variable: sparkdata2 in /session.php on line 363

econpy commented 10 years ago

Looks like something is different about your column names. Open up MySQL and do:

USE torque;
DESCRIBE raw_logs;

and post the output.

econpy commented 10 years ago

Your table looks perfect. Scanning through your PHP/Apache errors, it looks like the problem starts in get_columns.php as coldata never gets defined. I made some changes to get_columns.php that I'm hoping help find the problem. So, start by replacing your old get_columns.php with the new one.

If that doesn't solve it right away, then check to make sure the query that's run in the file works as it should. To do so, open an MySQL shell and run:

USE INFORMATION_SCHEMA;
SELECT COLUMN_NAME,COLUMN_COMMENT,DATA_TYPE FROM COLUMNS
WHERE TABLE_SCHEMA='torque'  AND TABLE_NAME='raw_logs';

You should get a result that looks similar to the table you just posted by running this command.

Let me know.

mo5245 commented 10 years ago

On session.php load with updated get_columns.php and parse_functions.php

PHP Notice: Undefined variable: d1 in /session.php on line 209 PHP Stack trace: PHP 1. {main}() /session.php:0 PHP Warning: Invalid argument supplied for foreach() in /session.php on line 209 PHP Stack trace: PHP 1. {main}() /session.php:0 PHP Notice: Undefined variable: d2 in /session.php on line 210 PHP Stack trace: PHP 1. {main}() /session.php:0 PHP Warning: Invalid argument supplied for foreach() in /session.php on line 210 PHP Stack trace: PHP 1. {main}() /session.php:0 PHP Notice: Undefined variable: v1_label in /session.php on line 213 PHP Stack trace: PHP 1. {main}() /session.php:0 PHP Notice: Undefined variable: v2_label in /session.php on line 214 PHP Stack trace: PHP 1. {main}() /session.php:0 PHP Notice: Undefined variable: v1_label in /session.php on line 226 PHP Stack trace: PHP 1. {main}() /session.php:0 PHP Notice: Undefined variable: v2_label in /session.php on line 229 PHP Stack trace: PHP 1. {main}() /session.php:0

after session selection

PHP Notice: Undefined variable: d1 in /session.php on line 209, referer: /session.php PHP Stack trace:, referer: /session.php PHP 1. {main}() /session.php:0, referer: /session.php PHP Warning: Invalid argument supplied for foreach() in /session.php on line 209, referer: /session.php PHP Stack trace:, referer: /session.php PHP 1. {main}() /session.php:0, referer: /session.php PHP Notice: Undefined variable: d2 in /session.php on line 210, referer: /session.php PHP Stack trace:, referer: /session.php PHP 1. {main}() /session.php:0, referer: /session.php PHP Warning: Invalid argument supplied for foreach() in /session.php on line 210, referer: /session.php PHP Stack trace:, referer: /session.php PHP 1. {main}() /session.php:0, referer: /session.php PHP Notice: Undefined variable: v1_label in /session.php on line 213, referer: /session.php PHP Stack trace:, referer: /session.php PHP 1. {main}() /session.php:0, referer: /session.php PHP Notice: Undefined variable: v2_label in /session.php on line 214, referer: /session.php PHP Stack trace:, referer: /session.php PHP 1. {main}() /session.php:0, referer: /session.php PHP Notice: Undefined variable: v1_label in /session.php on line 226, referer: /session.php PHP Stack trace:, referer: /session.php PHP 1. {main}() /session.php:0, referer: /session.php PHP Notice: Undefined variable: v2_label in /session.php on line 229, referer: /session.php PHP Stack trace:, referer: /session.php PHP 1. {main}() /session.php:0, referer: /session.php PHP Notice: Undefined variable: v1_label in /session.php on line 350, referer: /session.php PHP Stack trace:, referer: /session.php PHP 1. {main}() /session.php:0, referer: /session.php PHP Notice: Undefined variable: min1 in /session.php on line 351, referer: /session.php PHP Stack trace:, referer: /session.php PHP 1. {main}() /session.php:0, referer: /session.php PHP Notice: Undefined variable: max1 in /session.php on line 351, referer: /session.php PHP Stack trace:, referer: /session.php PHP 1. {main}() /session.php:0, referer: /session.php PHP Notice: Undefined variable: pcnt25data1 in /session.php on line 352, referer: /session.php PHP Stack trace:, referer: /session.php PHP 1. {main}() /session.php:0, referer: /session.php PHP Notice: Undefined variable: pcnt75data1 in /session.php on line 353, referer: /session.php PHP Stack trace:, referer: /session.php PHP 1. {main}() /session.php:0, referer: /session.php PHP Notice: Undefined variable: avg1 in /session.php on line 354, referer: /session.php PHP Stack trace:, referer: /session.php PHP 1. {main}() /session.php:0, referer: /session.php PHP Notice: Undefined variable: sparkdata1 in /session.php on line 355, referer: /session.php PHP Stack trace:, referer: /session.php PHP 1. {main}() /session.php:0, referer: /session.php PHP Notice: Undefined variable: v2_label in /session.php on line 358, referer: /session.php PHP Stack trace:, referer: /session.php PHP 1. {main}() /session.php:0, referer: /session.php PHP Notice: Undefined variable: min2 in /session.php on line 359, referer: /session.php PHP Stack trace:, referer: /session.php PHP 1. {main}() /session.php:0, referer: /session.php PHP Notice: Undefined variable: max2 in /session.php on line 359, referer: /session.php PHP Stack trace:, referer: /session.php PHP 1. {main}() /session.php:0, referer: /session.php PHP Notice: Undefined variable: pcnt25data2 in /session.php on line 360, referer: /session.php PHP Stack trace:, referer: /session.php PHP 1. {main}() /session.php:0, referer: /session.php PHP Notice: Undefined variable: pcnt75data2 in /session.php on line 361, referer: /session.php PHP Stack trace:, referer: /session.php PHP 1. {main}() /session.php:0, referer: /session.php PHP Notice: Undefined variable: avg2 in /session.php on line 362, referer: /session.php PHP Stack trace:, referer: /session.php PHP 1. {main}() /session.php:0, referer: /session.php PHP Notice: Undefined variable: sparkdata2 in /session.php on line 363, referer: /session.php PHP Stack trace:, referer: /session.php PHP 1. {main}() /session.php:0, referer: /session.php

mysql> USE INFORMATION_SCHEMA; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A

Database changed mysql> SELECT COLUMN_NAME,COLUMN_COMMENT,DATA_TYPE FROM COLUMNS -> WHERE TABLE_SCHEMA='torque' AND TABLE_NAME='raw_logs'; +-------------+---------------------+-----------+ | COLUMN_NAME | COLUMN_COMMENT | DATA_TYPE | +-------------+---------------------+-----------+ | v | | varchar | | session | | varchar | | id | | varchar | | time | | varchar | | kff1005 | | float | | kff1006 | | float | | kff1001 | Speed (GPS) | float | | kff1007 | GPS Bearing | float | | k4 | Engine Load | float | | k2f | Fuel Level | float | | k11 | Throttle Position | float | | k5 | Engine Coolant Temp | float | | kc | Engine RPM | float | | kd | Speed (OBD) | float | | kf | Intake Air Temp | float | | kff1226 | Horsepower | float | | kff1220 | Accel (X) | float | | kff1221 | Accel (Y) | float | | k46 | Ambiant Air Temp | float | | eml | | varchar | | profileName | | varchar | | notice | | varchar | | noticeClass | | varchar | +-------------+---------------------+-----------+ 23 rows in set (0.00 sec)

esticle commented 10 years ago

To add - I am experiencing the same issue with a freshly cloned copy, my apache error log looks much the same with undeclared variables, I can see the trip in the dropdown list but no values get plotted (which results in the apache error log as per above) nor the map.

econpy commented 10 years ago

esticle -- What versions of Apache, PHP, & MySQL are you running? What OS? mo5245 -- I know you're running PHP 5.3.13, but what versions of Apache & MySQL are you running?

Also, can the both of you please cd to the torque directory on your Apache server (e.g. /var/www/torque) and from within that directory run:

ls -l

so I can see the permissions/ownership of the files?

Also, just to be sure that we get the file ownership correctly, verify for me the name of the Apache user by running:

ps axho user,comm|grep -E "httpd|apache"|uniq|grep -v "root"|awk 'END {if ($1) print $1}'

which should output a username (most likely www-data).

mo5245 commented 10 years ago

CentOS release 6.5

Server version: Apache/2.2.15 (Unix) Server built: Jul 23 2014 14:15:00mys

5.5.29 MySQL Community Server (GPL) by Remi

directory user is apache

-rwxrwxr-x. 1 apache apache 201 Jul 24 19:59 creds.php -rwxrwxr-x. 1 apache apache 197 Jul 23 12:39 creds-sample.php drwxrwxr-x. 2 apache apache 4096 Jul 24 15:59 data -rwxrwxr-x. 1 apache apache 1568363 Jul 24 16:15 data.sql -rwxrwxr-x. 1 apache apache 1629 Jul 23 12:39 export.php -rwxrwxr-x. 1 apache apache 712 Jul 26 12:47 get_columns.php -rwxrwxr-x. 1 apache apache 880 Jul 23 12:39 get_sessions.php -rwxrwxr-x. 1 apache apache 1864 Jul 26 12:55 parse_functions.php -rwxrwxr-x. 1 apache apache 2756 Jul 23 12:39 plot.php -rwxrwxr-x. 1 apache apache 18366 Jul 24 16:30 session.php drwxrwxr-x. 4 apache apache 4096 Jul 24 15:59 static -rwxrwxr-x. 1 apache apache 69 Jul 23 12:39 timezone.php -rwxrwxr-x. 1 apache apache 1526 Jul 23 12:39 upload_data.php -rwxrwxr-x. 1 apache apache 1204 Jul 23 12:39 url.php

esticle commented 10 years ago

Hi!

I'm running it on a Wheezy Raspberry PI (Raspbian) with Apache 2.2.22, PHP 5.4.4 & MySQL 5.5.38

ls -l so I can see the permissions/ownership of the files?

Newbie typo - must've 'chown -R 644' instead of chmod so everything was owned by 644 :)

I changed mine over now to www-data:www-data - all files were readable by the webserver though and all directories were accessable by www-data - is any data written in the DocumentRoot ?

ps axho user,comm|grep -E "httpd|apache"|uniq|grep -v "root"|awk 'END {if ($1) print $1}' which should output a username (most likely www-data).

Yep as expected, www-data

Issue persists with undeclared variables after fixing ownership over to www-data, the map is zoomed in somewhere far north of New Zealand./ North East of Australia

Thanks! E

econpy commented 10 years ago

esticle: No files need write permission. See the following write-up for a final comprehensive guide to ensure permissions/ownership is correct.

mo5245: Whether or not it is the cause of the undeclared variables issue, your permissions are messed up. I mean, I have no idea what is in the data.sql file in your folder, but right now the universe can execute that file! You should also remove the creds-sample.php file since it serves no purpose after creating the creds.php file like you did.

For the both of you, I'd strongly recommend adding your personal user to the Apache user group. In esticle's case, assuming the user you personally use on that system is named "esticle", do this via:

sudo usermod -a -G www-data esticle

And for mo5245, assuming your personal user name is "mo5245" on your server:

sudo usermod -a -G apache mo5245

This will let you modify the web files without using sudo and/or having to reset file ownerships editing files on your web server. After running this command, change the ownership of the files in your torque web folder one last time.

Assuming your PHP files are at /var/www/torque:

mo5245 should do: sudo chown -R mo5245:apache /var/www/torque esticle should do: sudo chown -R esticle:www-data /var/www/torque

Now you shouldn't have to touch chown again. Finally, for peace of mind, we want to set 644 permissions on all files in our torque web folder and 755 permissions on all folders. This can be easily done with 2 commands:

find /var/www/torque -type d -exec chmod 755 {} +
find /var/www/torque -type f -exec chmod 644 {} +

Assuming you followed these directions properly, every permission and ownership of a file that has to do with this Github repo will be set and will not need to be touched again.

As I stated in the beginning, I don't suspect that this will solve the undeclared variables issue, but this is an absolutely vital step going forward. It also means we can cross permissions/ownership off the list of potential causes and begin digging deeper into possible PHP syntax/version issues that are causing this problem.

esticle commented 10 years ago

econpy,

Thanks for your help!

Hope I'm not being too difficult but I prefer not to have my normal user touch website content so actually prefer the owner to be someone that's not me so I've followed all your steps other than chown'ing my username in my torque path and adding my username to the www-data group..so everything is www-data:www-data and 755 for directories and 644 for files...

So everything looks like this now: http://pastebin.com/Yitg7spx My Apache error log looks like this: http://pastebin.com/7gMSF8wT

You're welcome to take a peek at http://torque.planthree.net/ as well

Thanks!

mo5245 commented 10 years ago

Yeah same issue with updated permissions, I moved to a local VM to do testing and get quicker log access. I tried the install on Ubuntu 12.04 and it works fine, seems to be some issue with Apache, MySQL and or PHP. I'll try some more and see if I can narrow it down.

Able to use centos Mysql DB on working Ubuntu without issue. More likely an Apache/PHP issue

working Ubuntu 12.04.4 LTS x64 (vm) MySQL version: 5.5.38-0ubuntu0.12.04.1 (Ubuntu) Apache Version Apache/2.2.22 (Ubuntu) Apache API Version 20051115 User/Group www-data(33)/33 PHP Version 5.3.10-1ubuntu3.13 PHP API 20090626 Loaded Modules: core mod_log_config mod_logio prefork http_core mod_so mod_alias mod_auth_basic mod_authn_file mod_authz_default mod_authz_groupfile mod_authz_host mod_authz_user mod_autoindex mod_cgi mod_deflate mod_dir mod_env mod_mime mod_negotiation mod_php5 mod_reqtimeout mod_setenvif mod_status

not working Centos 6.5 (vm) MySQL version: 5.5.29 MySQL Community Server (GPL) by Remi Apache Version Apache/2.2.15 Apache API Version 20051115 User/Group apache(48)/48 PHP Version 5.3.3 PHP API 20090626 Loaded Modules: core prefork http_core mod_so mod_ssl mod_auth_basic mod_auth_digest mod_authn_file mod_authn_alias mod_authn_anon mod_authn_dbm mod_authn_default mod_authz_host mod_authz_user mod_authz_owner mod_authz_groupfile mod_authz_dbm mod_authz_default util_ldap mod_authnz_ldap mod_include mod_log_config mod_logio mod_env mod_ext_filter mod_mime_magic mod_expires mod_deflate mod_headers mod_usertrack mod_setenvif mod_mime mod_dav mod_status mod_autoindex mod_info mod_dav_fs mod_vhost_alias mod_negotiation mod_dir mod_actions mod_speling mod_userdir mod_alias mod_substitute mod_rewrite mod_proxy mod_proxy_balancer mod_proxy_ftp mod_proxy_http mod_proxy_ajp mod_proxy_connect mod_cache mod_suexec mod_disk_cache mod_cgi mod_version mod_auth_mysql mod_perl mod_php5 mod_wsgi mod_reqtimeout

not working hosting provider Debian MySQL Version 5.5.32 Apache/2 PHP Version 5.3.13 PHP API 20090626

mo5245 commented 10 years ago

The working Ubuntu gets same errors.

PHP Notice: Undefined variable: d1 in /session.php on line 208 PHP Warning: Invalid argument supplied for foreach() in /session.php on line 208 PHP Notice: Undefined variable: d2 in session.php on line 209 PHP Warning: Invalid argument supplied for foreach() in /session.php on line 209 PHP Notice: Undefined variable: v1_label in /session.php on line 212 PHP Notice: Undefined variable: v2_label in /session.php on line 213 PHP Notice: Undefined variable: v1_label in /session.php on line 225 PHP Notice: Undefined variable: v2_label in /session.php on line 228

econpy commented 10 years ago

Ok, I think I finally tracked this issue down. The Javascript that gets loaded in session.php had a function (the stuff used to load data for making flot graphs) which would be loaded even if no session was selected. This caused the errors described here (I was able to replicate it myself). So I wrapped it in a if/else statement that would ensure it doesn't get loaded when there is no data to be loaded.

So I've updated session.php in this commit. Go ahead and download this new version of session.php and give it a shot.

econpy commented 10 years ago

Just added another fix to session.php in this commit. I tried it in my environment I initially replicated the error with and now all of the errors reported by PHP were gone.

Let me know if it does the trick for you!

esticle commented 10 years ago

Hi,

I've updated my session,php and unfortunately still the same issues when hitting the page and trying to display any session:

[Sat Aug 02 10:01:18 2014] [error] [client 192.168.3.67] PHP Notice: Undefined variable: d1 in /var/www/torque.planthree.net/session.php on line 215, referer: http://torque.planthree.net/session.php?id=1406872025358 [Sat Aug 02 10:01:18 2014] [error] [client 192.168.3.67] PHP Warning: Invalid argument supplied for foreach() in /var/www/torque.planthree.net/session.php on line 215, referer: http://torque.planthree.net/session.php?id=1406872025358 [Sat Aug 02 10:01:18 2014] [error] [client 192.168.3.67] PHP Notice: Undefined variable: d2 in /var/www/torque.planthree.net/session.php on line 216, referer: http://torque.planthree.net/session.php?id=1406872025358 [Sat Aug 02 10:01:18 2014] [error] [client 192.168.3.67] PHP Warning: Invalid argument supplied for foreach() in /var/www/torque.planthree.net/session.php on line 216, referer: http://torque.planthree.net/session.php?id=1406872025358 [Sat Aug 02 10:01:18 2014] [error] [client 192.168.3.67] PHP Notice: Undefined variable: v1_label in /var/www/torque.planthree.net/session.php on line 219, referer: http://torque.planthree.net/session.php?id=1406872025358 [Sat Aug 02 10:01:18 2014] [error] [client 192.168.3.67] PHP Notice: Undefined variable: v2_label in /var/www/torque.planthree.net/session.php on line 220, referer: http://torque.planthree.net/session.php?id=1406872025358 [Sat Aug 02 10:01:18 2014] [error] [client 192.168.3.67] PHP Notice: Undefined variable: v1_label in /var/www/torque.planthree.net/session.php on line 232, referer: http://torque.planthree.net/session.php?id=1406872025358 [Sat Aug 02 10:01:18 2014] [error] [client 192.168.3.67] PHP Notice: Undefined variable: v2_label in /var/www/torque.planthree.net/session.php on line 235, referer: http://torque.planthree.net/session.php?id=1406872025358 [Sat Aug 02 10:01:18 2014] [error] [client 192.168.3.67] PHP Notice: Undefined variable: v1_label in /var/www/torque.planthree.net/session.php on line 366, referer: http://torque.planthree.net/session.php?id=1406872025358 [Sat Aug 02 10:01:18 2014] [error] [client 192.168.3.67] PHP Notice: Undefined variable: min1 in /var/www/torque.planthree.net/session.php on line 367, referer: http://torque.planthree.net/session.php?id=1406872025358 [Sat Aug 02 10:01:18 2014] [error] [client 192.168.3.67] PHP Notice: Undefined variable: max1 in /var/www/torque.planthree.net/session.php on line 367, referer: http://torque.planthree.net/session.php?id=1406872025358 [Sat Aug 02 10:01:18 2014] [error] [client 192.168.3.67] PHP Notice: Undefined variable: pcnt25data1 in /var/www/torque.planthree.net/session.php on line 368, referer: http://torque.planthree.net/session.php?id=1406872025358 [Sat Aug 02 10:01:18 2014] [error] [client 192.168.3.67] PHP Notice: Undefined variable: pcnt75data1 in /var/www/torque.planthree.net/session.php on line 369, referer: http://torque.planthree.net/session.php?id=1406872025358 [Sat Aug 02 10:01:18 2014] [error] [client 192.168.3.67] PHP Notice: Undefined variable: avg1 in /var/www/torque.planthree.net/session.php on line 370, referer: http://torque.planthree.net/session.php?id=1406872025358 [Sat Aug 02 10:01:18 2014] [error] [client 192.168.3.67] PHP Notice: Undefined variable: sparkdata1 in /var/www/torque.planthree.net/session.php on line 371, referer: http://torque.planthree.net/session.php?id=1406872025358 [Sat Aug 02 10:01:18 2014] [error] [client 192.168.3.67] PHP Notice: Undefined variable: v2_label in /var/www/torque.planthree.net/session.php on line 374, referer: http://torque.planthree.net/session.php?id=1406872025358 [Sat Aug 02 10:01:18 2014] [error] [client 192.168.3.67] PHP Notice: Undefined variable: min2 in /var/www/torque.planthree.net/session.php on line 375, referer: http://torque.planthree.net/session.php?id=1406872025358 [Sat Aug 02 10:01:18 2014] [error] [client 192.168.3.67] PHP Notice: Undefined variable: max2 in /var/www/torque.planthree.net/session.php on line 375, referer: http://torque.planthree.net/session.php?id=1406872025358 [Sat Aug 02 10:01:18 2014] [error] [client 192.168.3.67] PHP Notice: Undefined variable: pcnt25data2 in /var/www/torque.planthree.net/session.php on line 376, referer: http://torque.planthree.net/session.php?id=1406872025358 [Sat Aug 02 10:01:18 2014] [error] [client 192.168.3.67] PHP Notice: Undefined variable: pcnt75data2 in /var/www/torque.planthree.net/session.php on line 377, referer: http://torque.planthree.net/session.php?id=1406872025358 [Sat Aug 02 10:01:18 2014] [error] [client 192.168.3.67] PHP Notice: Undefined variable: avg2 in /var/www/torque.planthree.net/session.php on line 378, referer: http://torque.planthree.net/session.php?id=1406872025358 [Sat Aug 02 10:01:18 2014] [error] [client 192.168.3.67] PHP Notice: Undefined variable: sparkdata2 in /var/www/torque.planthree.net/session.php on line 379, referer: http://torque.planthree.net/session.php?id=1406872025358

Just to confirm:

md5sum torque.planthree.net/session.php

b1f6ce4817aafcaca82447ee9fc94c38 torque.planthree.net/session.php

econpy commented 10 years ago

Can you make a dump of your database and zip your torque folder (but remove your info from creds.php obviously) and email them to me? nicklay@bcm.edu

This issue is bugging me and am determined to sort it out. To be certain about everything, I just need an exact copy of what you're working with. So shoot me an email with the files attached or a link to them hosted somewhere temporarily (e.g. Dropbox).

esticle commented 10 years ago

econpy,

Thanks a ton - I've emailed you with the information a minute ago, I'm sure it's something obvious :)

mo5245 commented 10 years ago

Same here, the working ubuntu dose not error any more even after session selection, But the centos dose get the same error log only on a selected session.

esticle commented 10 years ago

Thanks for the help econpy -

In short - my install was OK, this seems to be a version thing (I guess PHP)...

No idea yet why though...

jawillis commented 10 years ago

I've been tracking down a problem with my installation that might be related to this issue. I'm using a shared-hosting site (iPage). For some reason my db indexes are very large (time=1407194877272). Throughout the code, intval() is used on table indexes. These intval() calls are truncating my very large indexes to the max 32bit integer 2147483647, which causes the SELECT to yield zero hits.

samuelmr commented 10 years ago

I agree with @jawillis that this is a source for errors in 32 bit systems.

@econpy, e.g. in session.php, you have the lines:

$getid = mysql_real_escape_string($_POST['id']);
$session_id = intval($getid);

Is there a reason to call intval here? Maybe just

$session_id = preg_replace('/\D/', '', $_POST['id']);

if you want to make sure that only numbers are included. (Or check with is_numeric().)

econpy commented 10 years ago

It looks like the 32bit integers were the cause. I made a virtual box with 32bit Ubuntu 12.04 and set things up and got the typical errors mentioned in this issue. Then I went through get_sessions.php, session.php, and plot.php and changed the handling of integers, and sure enough now everything works on that system.

Here is the commit.

Give it a shot yourselves and lets see if we can close this issue!

By the way, thanks to @jawillis and @samuelmr for helping out on this one.

mo5245 commented 10 years ago

updated now im able to load sessions, the map and data summary on the 32 bit centos system but the chart shows and vertical line in the middle and the csv and json download essentially empty, probably same issue as #18 bug 18

econpy commented 10 years ago

CSV & JSON export was fixed in this commit. It was the same error "intval" error on 32 bit systems as before.

The plotting problem you're having is also an "intval" problem... but this one is marginally more interesting. Flot needs timestamps in milliseconds as an integer, but 32bit systems can only produce integers up to 2147483647. So, all of your timestamps for each data point are 2147483647. In other words, for all values of y, x is the same --- which is a graph of a vertical line. Anyways, I fixed it in this commit.

I tested both of these on my 32bit virtual box and it appears to work correctly. I can be sure you will let me know if it doesn't.

mo5245 commented 10 years ago

I think we got this one now, updated and CSV & JSON export and plot is working! bug 18-fixed

Side note was able to add MAF and Battery Voltage to SQL and it worked with out issue.

esticle commented 10 years ago

econpy,

Confirmed to be working! Moved it back to a Raspberry Pi and it's working fine now, thanks for this!