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

API maproulette.org/api/v2/challenge/50887/rebuild fails with Bad Gateway Response #2569

Open
tordans opened this issue Feb 18, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@tordans
Copy link
Contributor

tordans commented Feb 18, 2025

I am calling updates to rebuild my challenges and for some (or sometimes) I get Bad Gateway Response

This is an example:
https://maproulette.org/api/v2/challenge/50887/rebuild?removeUnmatched=true&skipSnapshot=false

I am using removeUnmatched=true to cleanup old data first.

 Failed to trigger rebuild for challenge: Bad Gateway Response (6.33 KB) {
  ok: false,
  url: "https://maproulette.org/api/v2/challenge/50887/rebuild?removeUnmatched=true&skipSnapshot=false",
  status: 502,
  statusText: "Bad Gateway",
  headers: Headers {
    "date": "Tue, 18 Feb 2025 10:22:20 GMT",
    "content-type": "text/html; charset=UTF-8",
    "content-length": "6330",
    "connection": "keep-alive",
    "report-to": "{\"endpoints\":[{\"url\":\"https:\\/\\/a.nel.cloudflare.com\\/report\\/v4?s=xxx\"}],\"group\":\"cf-nel\",\"max_age\":604800}",
    "x-frame-options": "SAMEORIGIN",
    "referrer-policy": "same-origin",
    "cache-control": "private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0",
    "expires": "Thu, 01 Jan 1970 00:00:01 GMT",
    "server-timing": "cfL4;desc=\"?proto=TCP&rtt=98605&min_rtt=98558&rtt_var=36993&sent=5&recv=6&lost=0&retrans=0&sent_bytes=3197&recv_bytes=882&delivery_rate=43832&cwnd=239&unsent_bytes=0&cid=29add4ebb9c06544&ts=75564&x=0\"",
    "nel": "{\"success_fraction\":0,\"report_to\":\"cf-nel\",\"max_age\":604800}",
    "server": "cloudflare",
    "cf-ray": "913d49cd9fd50f78-EWR",
    "alt-svc": "h3=\":443\"; ma=86400",
  },
  redirected: false,
  bodyUsed: false,
  Blob (6.33 KB)
}

I wonder if this is an error because the API tries to be synchronous but should be asynchronous?
What I expect to happen is, that I send the API call and get an "200 'request received'" response and then the server does the update asynchronously.

That is how I see it happen on the client when I use the rebuild-button, which loads a new web page and shows the progress bar.


Related questions

  • Should I also add skipSnapshot=true? Do I want to add this? Does it make thinks faster?

Note to self:

  • It looks like I can use the API to see if the rebuild was triggered (and is not finished, yet) by looking at challenge.status===1. Source1, Source2
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
Development

No branches or pull requests

1 participant