bfabiszewski / ulogger-server

μlogger • web viewer for tracks uploaded with μlogger mobile client
GNU General Public License v3.0
518 stars 84 forks source link

Bug: Admin settings does not save max upload size. #200

Closed brimwats closed 1 year ago

brimwats commented 1 year ago

I finally sorted admin access.

I went into settings image

then I set max size to 150

image

but then when I try to upload something It only allows 2mb:

image

if I refresh the page it resets to 2mb. What did I break?

bfabiszewski commented 1 year ago

This is probably limitation of your PHP settings. It resets back to maximum value allowed by your system. Check your PHP file size limits, especially upload_max_filesize, post_max_size, memory_limit

bfabiszewski commented 1 year ago

Also make sure your web server allows large uploads.

brimwats commented 1 year ago

Also make sure your web server allows large uploads.

thanks for the tip! I updated the ulogger.conf and the php.ini (upped everything to 300MB)

image

I now got the 150mb thing to work in settings (it defaults to that). I go to upload a 130MB file, but: image

157286400 = 157mbm right?

bfabiszewski commented 1 year ago

Maybe the uploaded file is larger? What is the size reported by ls -la command?

Did you try to increase the limit, for example to 200, and see what happens?

bfabiszewski commented 1 year ago

There is also overhead resulting from the form encoding with POST method. Generally you should set the limit to a higher value than the file size itself.

brimwats commented 1 year ago

The actual file is on windows, so uploading via the browser. It is reported

2022-05-07  12:52 PM            22,594 location_history_json_converter.py
2022-05-07  01:05 PM        40,891,581 Records.csv
2022-05-07  01:07 PM       129,688,951 Records.gpx
2022-05-07  01:09 PM       149,491,555 Records.gpxtracks
2022-05-07  11:22 AM       684,792,093 Records.json
2022-05-07  01:04 PM       263,230,043 Records.kml

So I upped it to 300mb: image

after I did that I realized that I may have been trying to upload a 323mb file. So I retried the 120mb one. It seems like ulogger took it, but after a bit of time waiting, nothing seems to have happened... netdata doesn't report the server as under heavy load so I'll look into it a bit more.

brimwats commented 1 year ago

Some progress! I finally got a loading icon (three purple dots) ; but ended up with a 504 error. So I need to look into that one now :)

bfabiszewski commented 1 year ago

Look into system logs: web server, php, syslog for warnings or errors.

BTW µlogger was created to record and view short sport activities, like trekking, biking routes, usually divided into one day paths. It may not be suitable for such large data sets that you try to upload. Even if you manage to upload it the browser may have problems rendering it properly if there are too many waypoints in a single track.

brimwats commented 1 year ago

That's all very fair. I'll try the logs. I suspect it's just timeout on one of the php or scripts. the server has quite a few CPUs and 60+gb ram. I'm basically looking to transfer ~10yr of google location history somewhere so I can delete it from google. If you had other recs I should try I'd appreciate it!

bfabiszewski commented 1 year ago

You may try to change time limit in PHP: max_execution_time. It may be also necessary to increase relevant timeout in web server settings.

Ten years of location history is too much. There are two options that come to my mind but may require some programming skills:

  1. Write a script (or find one) to divide large gpx file into multiple one-day tracks. Now I realized there is a script bundled with µlogger that allows one to import multiple files from command line. I never used it, as it was contributed by another user. You could use it to import your divided paths. Maybe there is a tool that will let you export from google maps into single day paths?
  2. Import the big file into µlogger. Use command line script if anything else fails. Write a script that will divide data imported into database into one-day paths.
brimwats commented 1 year ago

Thanks a ton for your support and insight! I'll close this as it is an issue on my end and not yours. I really appreciate it!