Closed x-sven closed 4 years ago
The message indicates that you're trying to add a location to the database where there already exists a location for. One tracker can not be in multiple places at the same time.
Thanks for the hint. I'm using android's owntrack app. It seems to be more or less a problem of the app. The log says, the record.php got multiple times the same location/time-combination.
It might be that the server didn't indicate a success (code 200) and so the app is trying to upload the same record again.
Hi Markus, I'm getting HTTP code 500 within the owntrack app and the endpoints are queued. I've cleared the buffer by restarting the app, then, the first data set is logged in the database, but the rest is queued again.
What does your Apache(?) server log say?
I'm using a webspace and do not know what kind of server is behind. I've found the following in the error.log:
[proxy_fcgi:error] [pid 112070:tid 140417362220800] [client 89.183.53.81:42082] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Error: Call to a member function getFriends() on null in /var/www/vhosts/serveraddress/lib/recorder/OwntracksRecorder.php:114\nStack trace:\n#0 /var/www/vhosts/serveraddress/record.php(78): OwntracksRecorder->getFriendsLocation(Object(OwntracksRecordStructure))\n#1 {main}\n thrown in /var/www/vhosts/serveraddress/lib/recorder/OwntracksRecorder.php on line 114'
Does that say anything?
Looks like a bug.
https://github.com/tomyvi/php-tracks-recorder/blob/master/lib/recorder/OwntracksRecorder.php#L114 tries to use $sql
without $sql
being defined anywhere.
Ok, can I support the issue with more details. I'm not an expert in php, however, I'm able to become one by the time... :-)
I think @tomyvi didn't quite finish this feature. You info should be enough, though.
In the meantime, you could try my fork: https://github.com/mbirth/php-owntracks-recorder .
Hi, thanks for the support! I guess, I would give your fork a trial, however, I use a common webspace and cannot install this yarn package manager that you are using.
You can run Composer and Yarn locally on your machine and then copy over the whole directory to your webspace.
Hi, I got the code to work. However, the record_log.txt shows an error about "duplicate location found for epoch". All of the time stamps are having the same number. Here is my config.inc.php:
`<?php
?>`
I've tried different settings for setlocale(). Does not have any effects. I'm using the latest git version.
I would be happy for any support!
Best regards Sven