Maps: Nc21 tracks keeps loadings sign

Created on 24 Mar 2021  Â·  23Comments  Â·  Source: nextcloud/maps

I have 2 Nc setups one with 20 and one with 21. In the 20 the tracks were shown in the 21 the same tracks was not. I now just update my NC20 environment and now the tracks also won`t load there anymore.
For one site i use hanssonit vmware image the other on a regular shared hosting.

I hope i did not overlook an already existing issue.

Most helpful comment

this.tracks[track.id].metadata = track.metadata === '' ? {} : $.parseJSON(track.metadata);

in the UI seems to fix it (tested by manually fiddeling it into the minified .js file)

All 23 comments

Same here.
I use the docker-image (nextcloud 21.0.0) with archlinux.
./occ maps:scan-photos and ./occ maps:scan-photos and even starting cron.php doesn't change this behavior.

Exactly the same problem. I'm using official docker image with NC 21.0.0 (fpm) and maps 0.1.8.
Looking at browser console, it shows "Uncaught SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data". Apparently GPX files no longer get processed correctly.

Can you paste the received tracks data. Somewhere in the browsers network monitor should be a get request for tracks.

Not sure what you are looking for but this is the only thing with track in the firefox console
Uncaught SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data jQuery 2 addTrackMap tracksController.js:294 getTracks tracksController.js:422 jQuery 7 getTracks tracksController.js:410 toggleTracks tracksController.js:153 restoreOptions script.js:284 jQuery 7 restoreOptions script.js:124 <anonymous> script.js:2139 jQuery 12 Webpack 6

other things maybe relevant
De bron van ‘https://xxx/apps/files/’ is geblokkeerd vanwege een niet-overeenkomend MIME-type (‘text/html’) (X-Content-Type-Options: nosniff).

Content Security Policy: De instellingen van de pagina blokkeerden het laden van een bron op inline (‘script-src’).

Handlebars is deprecated: please ship your own, this will be removed in Nextcloud 20

@tacruc:
Using network monitor, here is what I get for 'GET apps/maps/tracks' request - response payload is:
[{"id":2376,"file_id":1272,"color":null,"metadata":"","etag":"fc4537e367f49430806250867d0011dc","mtime":1594306367,"file_name":"my_route_0000.gpx","file_path":"\/Routes\/Bike\/my_route_0000.gpx"},{"id":2423,"file_id":10164,"color":null,"metadata":"","etag":"cb5d8ec3266b962cdfc5ca2a24867463","mtime":1615465459,"file_name":"my_route_0001.gpx","file_path":"\/Routes\/Bike\/my_route_0001.gpx"}]
(above is just an example, I have more valid routes but they are all look similar - metatada is an empty string). I have verified in NC database that cache etags and files on disk indeed do match each other and all are accessible.
Photos also cannot be viewed in full window (thumbnails are shown correctly on the map though), but I think it has already been reported elsewhere.

But it seams, that the json does not end correctly. Can you check, what's the end of the response. How long does the response take. Could it be a problem of php max execution time or could you additionally check if increasing the php memory limit helps?

This is the call I grabbed for you (https://nc.xxx.xx/index.php/apps/maps/tracks)
json.txt

Is the metadata entry in the DB meant to be empty, because it is on my nextcloud which has the problem described here?

All the gpx tracks are present in the DB, but every metadata variable is missing.

@tacruc:
php max execution time is set to NC default (3600 seconds), I've increased memory limit to 1G (was 512M), does not help at all.
Response time for 'GET tracks' is just under 1 second so it obviously does not hit the time limit.
Response header (as provided by Firefox Network console):

HTTP/1.1 200 OK
Server: nginx/1.19.3
Date: Mon, 29 Mar 2021 10:34:12 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 2726
Connection: keep-alive
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Pragma: no-cache
Cache-Control: no-cache, no-store, must-revalidate
Content-Security-Policy: default-src 'none';base-uri 'none';manifest-src 'self';frame-ancestors 'none'
Feature-Policy: autoplay 'none';camera 'none';fullscreen 'none';geolocation 'none';microphone 'none';payment 'none'
Content-Encoding: gzip
Strict-Transport-Security: max-age=15768000; includeSubDomains;
Referrer-Policy: no-referrer
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: SAMEORIGIN
X-Permitted-Cross-Domain-Policies: none
X-Robots-Tag: none, none
X-XSS-Protection: 1; mode=block

and for above header response payload is:
[{"id":2376,"file_id":1272,"color":null,"metadata":"","etag":"fc4537e367f49430806250867d0011dc","mtime":1594306367,"file_name":"2020-07-09-lucerny-zabie-paczkomat.gpx","file_path":"\/Routes\/Rower\/2020-07-09-lucerny-zabie-paczkomat.gpx"},{"id":2377,"file_id":3506,"color":null,"metadata":"","etag":"145aff48652f6b086803b38e7d8af35e","mtime":1594385147,"file_name":"2020-07-10-lazienkowski-czerniakowska-siekerkowski.gpx","file_path":"\/Routes\/Rower\/2020-07-10-lazienkowski-czerniakowska-siekerkowski.gpx"},{"id":2378,"file_id":4045,"color":null,"metadata":"","etag":"ecd1b7523658cc1f454aadd60c1c3c19","mtime":1594732723,"file_name":"2020-07-14-matecznik-zalewik-olszynka.gpx","file_path":"\/Routes\/Rower\/2020-07-14-matecznik-zalewik-olszynka.gpx"},{"id":2379,"file_id":4159,"color":null,"metadata":"","etag":"3c4f8bc84130e99639340d5d0adf3fd7","mtime":1594816189,"file_name":"2020-07-15-trakt-romantyczna-miedzeszynski.gpx","file_path":"\/Routes\/Rower\/2020-07-15-trakt-romantyczna-miedzeszynski.gpx"},{"id":2380,"file_id":4481,"color":null,"metadata":"","etag":"5f76b5d9971b07bca065fa0ffa7e2086","mtime":1595252526,"file_name":"2020-07-20-lazienkowski-nad_wisla-siekierkowski.gpx","file_path":"\/Routes\/Rower\/2020-07-20-lazienkowski-nad_wisla-siekierkowski.gpx"},{"id":2381,"file_id":4517,"color":null,"metadata":"","etag":"055ab23d0aaa29ea5715485396c89fa9","mtime":1595340258,"file_name":"2020-07-21-siekierkowski-czerniakowska-lazienkowski.gpx","file_path":"\/Routes\/Rower\/2020-07-21-siekierkowski-czerniakowska-lazienkowski.gpx"},{"id":2382,"file_id":4871,"color":null,"metadata":"","etag":"2d02ef358db7786e9e65a514d9320671","mtime":1595419758,"file_name":"2020-07-22-anin-lucerny-zabie.gpx","file_path":"\/Routes\/Rower\/2020-07-22-anin-lucerny-zabie.gpx"},{"id":2383,"file_id":5337,"color":null,"metadata":"","etag":"8a7ecff2d14567946938c5f8c37f7488","mtime":1595777661,"file_name":"2020-07-26-skaryszak_z_Edith_rowery.gpx","file_path":"\/Routes\/Rower\/2020-07-26-skaryszak_z_Edith_rowery.gpx"},{"id":2384,"file_id":5654,"color":null,"metadata":"","etag":"4f72c0dbbd50dbe52c5f951074fcbe01","mtime":1595943033,"file_name":"2020-07-28-skaryszewski-bulwary-lazienkowski.gpx","file_path":"\/Routes\/Rower\/2020-07-28-skaryszewski-bulwary-lazienkowski.gpx"},{"id":2385,"file_id":5835,"color":null,"metadata":"","etag":"638be1c2a9bdd59afc7f62e608f55753","mtime":1596026528,"file_name":"2020-07-29-skaryszewski-zalewik-olszynka.gpx","file_path":"\/Routes\/Rower\/2020-07-29-skaryszewski-zalewik-olszynka.gpx"},{"id":2386,"file_id":5861,"color":null,"metadata":"","etag":"9048bbf4a1ddd47a9b655b2b88dbafe2","mtime":1596204393,"file_name":"2020-07-31-lazienkowski-czerniakowska-siekerkowski.gpx","file_path":"\/Routes\/Rower\/2020-07-31-lazienkowski-czerniakowska-siekerkowski.gpx"},{"id":2387,"file_id":5960,"color":null,"metadata":"","etag":"d8bc681e3209e2a3b2d09fcd418be7af","mtime":1596635641,"file_name":"2020-08-05-miedzeszynski-zwyciezcow-iganska.gpx","file_path":"\/Routes\/Rower\/2020-08-05-miedzeszynski-zwyciezcow-iganska.gpx"},{"id":2388,"file_id":6009,"color":null,"metadata":"","etag":"97456618637f6075fe00b523b21ede67","mtime":1596716726,"file_name":"2020-08-06-park_matki_mojej-lucerny-zabie.gpx","file_path":"\/Routes\/Rower\/2020-08-06-park_matki_mojej-lucerny-zabie.gpx"},{"id":2389,"file_id":6015,"color":null,"metadata":"","etag":"357e5c49195ff9f97308011c997cf567","mtime":1596839032,"file_name":"2020-08-07-siekierkowski-czerniakowska-lazienkowski.gpx","file_path":"\/Routes\/Rower\/2020-08-07-siekierkowski-czerniakowska-lazienkowski.gpx"},{"id":2390,"file_id":6323,"color":null,"metadata":"","etag":"eefe2d6b3df625a292b841af67a0766d","mtime":1597155912,"file_name":"2020-08-11-gwarkow-zalewik-olszynka.gpx","file_path":"\/Routes\/Rower\/2020-08-11-gwarkow-zalewik-olszynka.gpx"},{"id":2391,"file_id":6363,"color":null,"metadata":"","etag":"44f5cc7966ec8f0829156a452701da28","mtime":1597238334,"file_name":"2020-08-12-lazienkowski-czerniakowska-siekierkowski.gpx","file_path":"\/Routes\/Rower\/2020-08-12-lazienkowski-czerniakowska-siekierkowski.gpx"},{"id":2392,"file_id":6427,"color":null,"metadata":"","etag":"e0779c12390c9c380f6babf55a99a03e","mtime":1597409734,"file_name":"2020-08-14-trakt-miedzeszynski-poprawna.gpx","file_path":"\/Routes\/Rower\/2020-08-14-trakt-miedzeszynski-poprawna.gpx"},{"id":2393,"file_id":6445,"color":null,"metadata":"","etag":"3cc2fc3007201401148b880fb3858575","mtime":1597841190,"file_name":"2020-08-19-skaryszewski-bulwary-miedzeszynski.gpx","file_path":"\/Routes\/Rower\/2020-08-19-skaryszewski-bulwary-miedzeszynski.gpx"},{"id":2394,"file_id":6546,"color":null,"metadata":"","etag":"f0973e4a38e6dd45ee6f9d9c9f30127c","mtime":1597931923,"file_name":"2020-08-20-rodzynkowa-zabie-lucerny.gpx","file_path":"\/Routes\/Rower\/2020-08-20-rodzynkowa-zabie-lucerny.gpx"},{"id":2395,"file_id":6819,"color":null,"metadata":"","etag":"16424bb29826738621d4e5e57476f35b","mtime":1598272090,"file_name":"2020-08-24-makowska-olszynka-staw_kozia_gorka.gpx","file_path":"\/Routes\/Rower\/2020-08-24-makowska-olszynka-staw_kozia_gorka.gpx"},{"id":2396,"file_id":6827,"color":null,"metadata":"","etag":"19116d501de97f3667c6c0485f5312d3","mtime":1598446620,"file_name":"2020-08-26-siekierkowski-czerniakowska-lazienkowski.gpx","file_path":"\/Routes\/Rower\/2020-08-26-siekierkowski-czerniakowska-lazienkowski.gpx"},{"id":2397,"file_id":7493,"color":null,"metadata":"","etag":"68b7131c313dbe7d1a63a0bd0c075cce","mtime":1599135712,"file_name":"2020-09-03-skaryszewski-zalewik-olszynka.gpx","file_path":"\/Routes\/Rower\/2020-09-03-skaryszewski-zalewik-olszynka.gpx"},{"id":2398,"file_id":7561,"color":null,"metadata":"","etag":"2badd7e087e88b77e7e31d06a13686ef","mtime":1599232864,"file_name":"2020-09-04-lucerny-zabie-kanalek.gpx","file_path":"\/Routes\/Rower\/2020-09-04-lucerny-zabie-kanalek.gpx"},{"id":2399,"file_id":7632,"color":null,"metadata":"","etag":"b39d39e05a4ca6252cb40322e3f18e27","mtime":1599637170,"file_name":"2020-09-08-lazienkowski-czerniakowska-siekerkowski.gpx","file_path":"\/Routes\/Rower\/2020-09-08-lazienkowski-czerniakowska-siekerkowski.gpx"},{"id":2400,"file_id":7634,"color":null,"metadata":"","etag":"0d01629bf5aeebe85616e545af750c98","mtime":1599672080,"file_name":"2020-09-09-trakt-miedzeszynski-paczkomat.gpx","file_path":"\/Routes\/Rower\/2020-09-09-trakt-miedzeszynski-paczkomat.gpx"},{"id":2401,"file_id":7637,"color":null,"metadata":"","etag":"31b179ddf844315380274b42257677c1","mtime":1599743880,"file_name":"2020-09-10-skaryszewski-wschodni-szaserow.gpx","file_path":"\/Routes\/Rower\/2020-09-10-skaryszewski-wschodni-szaserow.gpx"},{"id":2402,"file_id":7789,"color":null,"metadata":"","etag":"02af0e37f5a19f6ac0432419acaf9593","mtime":1600091422,"file_name":"2020-09-14-matecznik-zalewik-olszynka.gpx","file_path":"\/Routes\/Rower\/2020-09-14-matecznik-zalewik-olszynka.gpx"},{"id":2403,"file_id":7872,"color":null,"metadata":"","etag":"4492a7567c181a6d9c04a1cb94f64ed5","mtime":1600173016,"file_name":"2020-09-15-miedzyborska-nad_wisla-zakole.gpx","file_path":"\/Routes\/Rower\/2020-09-15-miedzyborska-nad_wisla-zakole.gpx"},{"id":2404,"file_id":8011,"color":null,"metadata":"","etag":"21baabbc24d7b0e29f1f77c19f3a00b1","mtime":1600433746,"file_name":"2020-09-18-lucerny-zabie-paczkomat.gpx","file_path":"\/Routes\/Rower\/2020-09-18-lucerny-zabie-paczkomat.gpx"},{"id":2405,"file_id":8179,"color":null,"metadata":"","etag":"ada84d33e249082afbfe3b7dce16fb64","mtime":1600804845,"file_name":"2020-09-22-pompy_siekierki-czerniakowska-lazienkowski.gpx","file_path":"\/Routes\/Rower\/2020-09-22-pompy_siekierki-czerniakowska-lazienkowski.gpx"},{"id":2406,"file_id":8224,"color":null,"metadata":"","etag":"34646776b6254c562d0bc691a860b138","mtime":1600940605,"file_name":"2020-09-23-miedzeszynski-kanalek-paczkomat.gpx","file_path":"\/Routes\/Rower\/2020-09-23-miedzeszynski-kanalek-paczkomat.gpx"},{"id":2407,"file_id":8227,"color":null,"metadata":"","etag":"bb84ed0476b726d75bbd87f322115696","mtime":1601057389,"file_name":"2020-09-25-lazienkowski-czerniakowska-siekierkowski.gpx","file_path":"\/Routes\/Rower\/2020-09-25-lazienkowski-czerniakowska-siekierkowski.gpx"},{"id":2408,"file_id":8369,"color":null,"metadata":"","etag":"a3aa71f1edb8e89bb0dd843d30fbc8dc","mtime":1602002390,"file_name":"2020-10-06-skaryszewski-zalewik-olszynka.gpx","file_path":"\/Routes\/Rower\/2020-10-06-skaryszewski-zalewik-olszynka.gpx"},{"id":2409,"file_id":8641,"color":null,"metadata":"","etag":"b6ada0a11dcb584ace13cd5d10b1042d","mtime":1602177256,"file_name":"2020-10-08-lucerny-zabie-kanalek.gpx","file_path":"\/Routes\/Rower\/2020-10-08-lucerny-zabie-kanalek.gpx"},{"id":2410,"file_id":8654,"color":null,"metadata":"","etag":"ff401d025c0b6d01fec3622125d4cd18","mtime":1602185107,"file_name":"2020-10-08-skaryszewski_wieczorem_z_Mariuszem.gpx","file_path":"\/Routes\/Rower\/2020-10-08-skaryszewski_wieczorem_z_Mariuszem.gpx"},{"id":2411,"file_id":5187,"color":null,"metadata":"","etag":"0ba0896fd235ffb09a06e4155150c357","mtime":1595715468,"file_name":"2020-07-25-balaton_z_Edith_i_Zbyszkiem.gpx","file_path":"\/Routes\/Wycieczki\/2020-07-25-balaton_z_Edith_i_Zbyszkiem.gpx"},{"id":2412,"file_id":7630,"color":null,"metadata":"","etag":"950bbcee95331cbe3a474008fe300502","mtime":1599560963,"file_name":"2020-09-06-Pariwar_pieszo.gpx","file_path":"\/Routes\/Wycieczki\/2020-09-06-Pariwar_pieszo.gpx"},{"id":2413,"file_id":8980,"color":null,"metadata":"","etag":"7e12227ca620c01831a697e8cfa2e3a5","mtime":1607427487,"file_name":"2020-12-08-spacer-Kordeckiego-Zagojska-park_Znicza.gpx","file_path":"\/Routes\/Wycieczki\/2020-12-08-spacer-Kordeckiego-Zagojska-park_Znicza.gpx"},{"id":2414,"file_id":8982,"color":null,"metadata":"","etag":"260fa259b8e3c59556cdd447f5bfc8b0","mtime":1607559629,"file_name":"2020-12-09-spacer-Balaton-przychodnia.gpx","file_path":"\/Routes\/Wycieczki\/2020-12-09-spacer-Balaton-przychodnia.gpx"},{"id":2415,"file_id":9155,"color":null,"metadata":"","etag":"15bb5a9ccb57a37c8cf9120c1f82b0d8","mtime":1608199037,"file_name":"2020-12-17-spacer-Ostrobramska-Budrysow-park_Znicza.gpx","file_path":"\/Routes\/Wycieczki\/2020-12-17-spacer-Ostrobramska-Budrysow-park_Znicza.gpx"},{"id":2416,"file_id":9239,"color":null,"metadata":"","etag":"cb67044bb1d590a2f043d01a067bef69","mtime":1608634509,"file_name":"2020-12-22-spacer-Ostrobramska-Filomatow-park_Znicza.gpx","file_path":"\/Routes\/Wycieczki\/2020-12-22-spacer-Ostrobramska-Filomatow-park_Znicza.gpx"},{"id":2417,"file_id":9325,"color":null,"metadata":"","etag":"fbd94b53f058d34eced72c5332f4f9d1","mtime":1609081130,"file_name":"2020-12-27-spacer_z_Edith-park_Znicza-Bialowieska.gpx","file_path":"\/Routes\/Wycieczki\/2020-12-27-spacer_z_Edith-park_Znicza-Bialowieska.gpx"},{"id":2418,"file_id":9332,"color":null,"metadata":"","etag":"1f6c2d78e05576cb7f0748821d694ae9","mtime":1610113982,"file_name":"2021-01-08-spacer-Bazar-Kordeckiego-Putka.gpx","file_path":"\/Routes\/Wycieczki\/2021-01-08-spacer-Bazar-Kordeckiego-Putka.gpx"},{"id":2419,"file_id":9349,"color":null,"metadata":"","etag":"845eea8e9c3548f5db69d65da3bc1ba7","mtime":1610459600,"file_name":"2021-01-12-spacer-Empik-Budrysow-park_Znicza.gpx","file_path":"\/Routes\/Wycieczki\/2021-01-12-spacer-Empik-Budrysow-park_Znicza.gpx"},{"id":2420,"file_id":9527,"color":null,"metadata":"","etag":"67c40275b04647938b706310992db856","mtime":1611673950,"file_name":"2021-01-26-spacer_z_Edith-Mladzka-Lukiska-Kaufland.gpx","file_path":"\/Routes\/Wycieczki\/2021-01-26-spacer_z_Edith-Mladzka-Lukiska-Kaufland.gpx"},{"id":2421,"file_id":9560,"color":null,"metadata":"","etag":"3b4c081a4b2f5db8ca61a4f3c4293e0f","mtime":1612100358,"file_name":"2021-01-31-spacer_z_Edith-WOSP-Balaton.gpx","file_path":"\/Routes\/Wycieczki\/2021-01-31-spacer_z_Edith-WOSP-Balaton.gpx"},{"id":2422,"file_id":10132,"color":null,"metadata":"","etag":"991b0b70e1a3ee5d587ff5ffa3ccc27b","mtime":1614605294,"file_name":"2021-03-01-spacer-Kordeckiego-Zagojska-park_Znicza.gpx","file_path":"\/Routes\/Wycieczki\/2021-03-01-spacer-Kordeckiego-Zagojska-park_Znicza.gpx"},{"id":2423,"file_id":10164,"color":null,"metadata":"","etag":"cb5d8ec3266b962cdfc5ca2a24867463","mtime":1615465459,"file_name":"2021-03-11-spacer-Kaufland-Budrysow-park_Znicza.gpx","file_path":"\/Routes\/Wycieczki\/2021-03-11-spacer-Kaufland-Budrysow-park_Znicza.gpx"}]
This is complete response as seen by browser network tool.

Hi! Just wanted to say I get the exact same bug. Nextcloud 21, Maps 0.1.8.
I get the infinite loading of tracks that never displays them.
I have recorded my tracks with the RunnerUp app on Android and they open properly on the other app GPX Viewer.

I get the similar error Uncaught SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data in the console.

I also grabbed the request from the network tab on my brower

[{"id":12,"file_id":531931,"color":null,"metadata":"","etag":"137943c34def42031ea6d3b34b52b1a8","mtime":1610313461,"file_name":"RunnerUp_2021-01-10-17-26-20_Running.gpx","file_path":"\/Documents\/Runnerup\/RunnerUp_2021-01-10-17-26-20_Running.gpx"},{"id":13,"file_id":532870,"color":null,"metadata":"","etag":"4060d4ddcd1b29ee49e3cfcaecf44483","mtime":1610994197,"file_name":"RunnerUp_2021-01-18-18-51-56_Running.gpx","file_path":"\/Documents\/Runnerup\/RunnerUp_2021-01-18-18-51-56_Running.gpx"},{"id":14,"file_id":549493,"color":null,"metadata":"","etag":"b448167c176335d0fe167f6f5936cdde","mtime":1611078346,"file_name":"RunnerUp_2021-01-19-15-09-24_Walking.gpx","file_path":"\/Documents\/Runnerup\/RunnerUp_2021-01-19-15-09-24_Walking.gpx"},{"id":15,"file_id":549428,"color":null,"metadata":"","etag":"0e680369374baf0fcf3dee529d5a8826","mtime":1611850979,"file_name":"RunnerUp_2021-01-28-16-44-18_Running.gpx","file_path":"\/Documents\/Runnerup\/RunnerUp_2021-01-28-16-44-18_Running.gpx"},{"id":16,"file_id":549555,"color":null,"metadata":"","etag":"6506dbb1b454973704809eabc8eb5dd7","mtime":1612374139,"file_name":"RunnerUp_2021-02-03-18-15-45_Running.gpx","file_path":"\/Documents\/Runnerup\/RunnerUp_2021-02-03-18-15-45_Running.gpx"},{"id":17,"file_id":549435,"color":null,"metadata":"","etag":"f69d44b79ea3fe01da95332680a92adb","mtime":1614191343,"file_name":"RunnerUp_2021-02-24-18-48-20_Running.gpx","file_path":"\/Documents\/Runnerup\/RunnerUp_2021-02-24-18-48-20_Running.gpx"},{"id":18,"file_id":549458,"color":null,"metadata":"","etag":"d09022c8a440a8a50ef07aea35c4ea21","mtime":1614520886,"file_name":"RunnerUp_2021-02-28-13-58-48_Running.gpx","file_path":"\/Documents\/Runnerup\/RunnerUp_2021-02-28-13-58-48_Running.gpx"},{"id":19,"file_id":549510,"color":null,"metadata":"","etag":"82c103e014f67325e09f750400ae6904","mtime":1615553297,"file_name":"RunnerUp_2021-03-12-13-07-05_Running.gpx","file_path":"\/Documents\/Runnerup\/RunnerUp_2021-03-12-13-07-05_Running.gpx"},{"id":20,"file_id":549420,"color":null,"metadata":"","etag":"cf8b9a7f807c1b021eff9b5f39c9adc8","mtime":1615560107,"file_name":"RunnerUp_2021-03-12-13-48-36_Running.gpx","file_path":"\/Documents\/Runnerup\/RunnerUp_2021-03-12-13-48-36_Running.gpx"},{"id":21,"file_id":549548,"color":null,"metadata":"","etag":"35b601cff2106b261c8e5584305bacc7","mtime":1615560538,"file_name":"RunnerUp_2021-03-12-15-43-17_Running.gpx","file_path":"\/Documents\/Runnerup\/RunnerUp_2021-03-12-15-43-17_Running.gpx"},{"id":22,"file_id":549467,"color":null,"metadata":"","etag":"40640b6aadcaede9397b058dca0f6686","mtime":1617561489,"file_name":"RunnerUp_2021-04-04-16-58-24_Walking.gpx","file_path":"\/Documents\/Runnerup\/RunnerUp_2021-04-04-16-58-24_Walking.gpx"}]

I don't really see how this request can be considered as bad json :/
Any idea?

Here is the content of the maps_tracks table of the DB

MariaDB [cloud_db]> SELECT * from maps_tracks;
+----+---------+---------+----------------------------------+-------+----------+
| id | user_id | file_id | etag                             | color | metadata |
+----+---------+---------+----------------------------------+-------+----------+
| 12 | julien  |  531931 | 137943c34def42031ea6d3b34b52b1a8 | NULL  |          |
| 13 | julien  |  532870 | 4060d4ddcd1b29ee49e3cfcaecf44483 | NULL  |          |
| 14 | julien  |  549493 | b448167c176335d0fe167f6f5936cdde | NULL  |          |
| 15 | julien  |  549428 | 0e680369374baf0fcf3dee529d5a8826 | NULL  |          |
| 16 | julien  |  549555 | 6506dbb1b454973704809eabc8eb5dd7 | NULL  |          |
| 17 | julien  |  549435 | f69d44b79ea3fe01da95332680a92adb | NULL  |          |
| 18 | julien  |  549458 | d09022c8a440a8a50ef07aea35c4ea21 | NULL  |          |
| 19 | julien  |  549510 | 82c103e014f67325e09f750400ae6904 | NULL  |          |
| 20 | julien  |  549420 | cf8b9a7f807c1b021eff9b5f39c9adc8 | NULL  |          |
| 21 | julien  |  549548 | 35b601cff2106b261c8e5584305bacc7 | NULL  |          |
| 22 | julien  |  549467 | 40640b6aadcaede9397b058dca0f6686 | NULL  |          |
+----+---------+---------+----------------------------------+-------+----------+
11 rows in set (0.003 sec)

Having the same issue on NC21, Maps 0.1.8.

Uncaught SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data
jQuery 2
addTrackMap tracksController.js:294
getTracks tracksController.js:422
jQuery 4
jquery-migrate.min.js:2:2468

metoo - is there some workaround in sight ?

It seems to try to de-serialize the metadata field (which is empty for me (and also seems to be empty for everyone else in this issue)):
Screenshot from 2021-04-12 11-25-13

So probably the maps:scan-* jobs are supposed to fill it (but somehow they don't?)

Hm... Though the code always seems to add the metadata empty:
https://github.com/nextcloud/maps/blob/9facdf4a2e44956215bdbec38becaa62023e8783/lib/Service/TracksService.php#L284

The code of the UI also was not changed recently... So not sure what might cause this suddenly? (I personally cannot confirm that this only happens after an update, I only enabled Map after the 21 update).

Ah. https://github.com/nextcloud/maps/blob/c639d0b6452aca7b50fc8cddf59dedd222bdb310/lib/Controller/TracksController.php#L131 seems to be responsible to generate it once the track is requested. But I guess since the track is never requested that does not happen.

Hm... Though the code always seems to add the metadata empty:

https://github.com/nextcloud/maps/blob/9facdf4a2e44956215bdbec38becaa62023e8783/lib/Service/TracksService.php#L284

I changed that line to $metadata = '{}' and that seems to "solves" the issue for me. Alternatively one could probably also patch the UI to gracefully handle non-existing metadata. Not sure if this is a proper fix of course.

though now trackdetails do not get displayed: Screenshot from 2021-04-12 11-46-48

So I assume my "fix" does not work since the metadata now will not get generated at all.

this.tracks[track.id].metadata = track.metadata === '' ? {} : $.parseJSON(track.metadata);

in the UI seems to fix it (tested by manually fiddeling it into the minified .js file)

Added a PR, though I am not sure why the metadata is loaded there at all... Maybe the line can simply be removed?

(otherwise: sorry for the spam :P)

Hey! I just tried to build this fix into my install and it fixed it for me! Tracks are loaded now! 🙏 thanks for your work and contribution

I just realized that I still have one file which triggers a similar error... The file contains a
"trnl": ,
(which obviously is wrong). But I guess that is a separate issue...

Hey.

Indeed, seems to work for me too.

For impatient people, in the minified :
image
instead of
image

in js/script.js, about char 1886888 line 82

ok.

as i dont want to edit the source code, by when do you think is a patch oder new release avalaible?

Was this page helpful?
0 / 5 - 0 ratings