bfabiszewski/ulogger-android

Cannot upload location with images HTTP error 400

justpbk opened this issue · 11 comments

following is the log
[postForm: https://myurl/client/index.php : {altitude=-81.0, provider=network, trackid=15, accuracy=60.0, action=addpos, lon=98.9298, comment=Bhj, time=1686582516, lat=56.8250304}, image=file:///data/user/0/net.fabiszewski.ulogger.debug/files/ulogger_20230612_203924.jpg]
[getFileMime (ext): image/jpeg]
[getFileSize (fd): 38713]
[getMultipartLength: 39790]
(HTTPLog)-Static: isSBSettingEnabled false
(HTTPLog)-Static: isSBSettingEnabled false
[getFileMime (ext): image/jpeg]
[getFileSize (fd): 38713]
EGLNativeWindowType 0x77bd12e010 disconnect failed
eglDestroySurface = 0x77b497e080, 0x77bd12e000
dispatchDetachedFromWindow
Surface release. android.view.ViewRootImpl.doDie:7931 android.view.ViewRootImpl.die:7899 android.view.WindowManagerGlobal.removeViewLocked:497 android.view.WindowManagerGlobal.removeView:435 android.view.WindowManagerImpl.removeViewImmediate:124 android.widget.Toast$TN.handleHide:1126 android.widget.Toast$TN$1.handleMessage:914 android.os.Handler.dispatchMessage:106
Input channel destroyed: fd=89
[doSync: io exception: java.io.IOException: HTTP error code: 400]
[handleError: retry: HTTP error code: 400]
[onDestroy]
[-openCount = 1]
[broadcast received Intent { act=net.fabiszewski.ulogger.broadcast.sync_failed flg=0x10 (has extras) }]

I suppose that must be some server side problem, like too low limit of POST request size. Please check server logs.
Which ulogger-server version do you use? What web server runs on your site?

server master downloader from here and no upgrade done. https://github.com/bfabiszewski/ulogger-server
Server run on Cpanel already changed Post file size in to 250M.

now getting 406 error (Time to Time) > without submitting image 2023-06-14 23:31:38.911 15388-22564 WebSyncService net.fabiszewski.ulogger.debug D [postForm: https://broo/client/index.php : {altitude=-09.7020426495001, provider=gps, trackid=35, accuracy=96.0, action=addpos, lon=89.9299728789379, comment=Huuj, time=1067450452, lat=6.82505581116668}, image=null]

please check time is wrong sometime it shows Wednesday, October 29, 2003 6:00:52 PM but current time is Wednesday, June 14, 2023 11:06:52 PM

You need to look at you web server logs. Turn on the logging if necessary.
You may also ask your provider if they not have any protection against automated request.
The time seems to be wrong but it should not affect the upload. What is your android device?

Will check with server admin then
Samsung galaxy s9 Plus

Cpanel is you web control panel. I was asking about your web server. I mean, is it apache, nginx or anything else?

Image upload issue is with my shared server. I tried with local host and it worked without an issue.
but now issue is with the time 2003-10-30

if way point captured only with text it updated as 2003-10-30 others 2023-06-15

As you have a debug version of the android app, could you post the whole log from this operation?
If you don't want to post it publicly because of privacy issues, you can send it by email (you will find it on my webpage).

The time is taken from location data reported by device (using getTime() function). If the source of the location is GPS, it should be GPS time. Otherwise may be based on different sources. Is the device clock properly set?

The problem may be related to GPS rollover bug.
It would be helpful to see the whole log covering both good GPS readings with correct time, as well as wrong readings.

Maybe the log will not be necessary. I found the problem.
I applied a fix 39ee518
Please try if it helps.

Seems like issue is fixed. Will test more and let you know. Thanks