Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-upload does not work for some GPX files #62

Open
WetenSchaap opened this issue May 9, 2024 · 4 comments
Open

Auto-upload does not work for some GPX files #62

WetenSchaap opened this issue May 9, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@WetenSchaap
Copy link

WetenSchaap commented May 9, 2024

Presumably related to #56.

Some of my gpx files (example here, same as mentioned in #56) are not uploaded automatically from the auto-upload folder. When I run the job manually I get the following error message:

/app/uploads/9-la-sage-to-cabane-moiry.gpx
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  6820  100   486  100  6334  46565   592k --:--:-- --:--:-- --:--:--  666k
{
  "url":"http://db:8090/api/collections/trails/records",
  "status":400,
  "response":{
    "code":400,
    "message":"Failed to create record.",
    "data":{
      "name":{
        "code":"validation_required",
        "message":"Missing required value."
  }}},
  "isAbort":false,
  "originalError":{
    "url":"http://db:8090/api/collections/trails/records",
    "status":400,
    "data":{
      "code":400,
      "message":
      "Failed to create record.",
      "data":{
        "name":{
          "code":"validation_required",
          "message":"Missing required value."
  }}}},
  "name":"ClientResponseError 400"
}

Other GPX-files do get uploaded as expected, so it probably has something to do with the <rte> tag again?

@Flomp
Copy link
Owner

Flomp commented May 9, 2024

After some testing, I can say that this issue is unrelated to #56. The error occurs because the trail has no name tag in the metadata section. wanderer parses this section to determine the trail name when uploading through the API. If the trail name is empty PocketBase rejects the insert attempt as the name field is required for a trail entry.

The trail you provided as an example has a name, so it uploads without problems in my tests.

@WetenSchaap
Copy link
Author

You are absolutely right, the example file was actually the only file in a group that did upload correctly - oops. The others do have a name, but defined outside the metadata section: see correct example here.

At any rate, just erroring out because a track has no name may not be the right way to go? Maybe a fallback to the file name is a better strategy?

@Flomp
Copy link
Owner

Flomp commented May 9, 2024

I agree. Trails without a name will get a generic "trail-" name in the next patch.
I won't take names outside of the metadata tag into account as they are not part of the official GPX specs.

@Flomp Flomp added the bug Something isn't working label May 9, 2024
@WetenSchaap
Copy link
Author

I won't take names outside of the metadata tag into account as they are not part of the official GPX specs.

That makes complete sense, probably better to keep Pandora's box firmly closed.

Thanks for the great work, it is really appreciated! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants