maproulette / maproulette/maproulette-backend

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

Open
#1,180 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Scala
Stars
53
Forks
39
Avg merge
1d 17h
Merged PRs (30d)
12

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the API rebuild endpoint and compare it with the client flow in src/components/AdminPane/Manage/ViewChallengeTasks/TaskBuildProgress.jsx and src/services/Challenge/ChallengeStatus/ChallengeStatus.js. Reproduce the 502 using the provided challenge URL and establish the expected response and status transitions for asynchronous rebuilds.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.