c2corg / v6_api

REST API for https://www.camptocamp.org
GNU Affero General Public License v3.0
22 stars 26 forks source link

Bug: New route with bad geometry #807

Open AntoineMarnat opened 4 years ago

AntoineMarnat commented 4 years ago

Describe the bug See https://forum.camptocamp.org/t/suppression-dun-itineraire/145698/9

Two routes were added, with a gpx with extra informations ( which one to be determined). They make the API bug:

https://www.camptocamp.org/routes/1203651 https://www.camptocamp.org/routes/1203650

Request failed with status code 500

Also, it makes the following error when trying to access it with a bot:

https://forum.camptocamp.org/t/suppression-dun-itineraire/145698/9?u=antoinem

and during the check_rc procedure:

Fix recent changes
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/bin/campbot", line 10, in <module>
    sys.exit(main_entry_point())
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/campbot/__main__.py", line 66, in main_entry_point
    main(docopt(__doc__))
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/campbot/__main__.py", line 75, in main
    ask_before_saving=not args["--batch"])
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/campbot/checkers.py", line 165, in check_recent_changes
    bot.fix_recent_changes(oldest_date, newest_date, lang, ask_before_saving)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/campbot/core.py", line 690, in fix_recent_changes
    self._process_documents(get_documents(), processors, [lang, ], ask_before_saving)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/campbot/core.py", line 557, in _process_documents
    for document in documents:
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/campbot/core.py", line 684, in get_documents
    document = self.wiki.get_wiki_object(document_id, document_type=document_type)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/campbot/core.py", line 133, in get_wiki_object
    return constructor(self.campbot, self.get("/{}/{}".format(constructor.url_path, item_id)))
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/campbot/core.py", line 67, in get
    res.raise_for_status()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: https://api.camptocamp.org/routes/1203651
macbook-de-toinou-4:~ Toinou$ 

One should:

asaunier commented 4 years ago

requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.demov6.camptocamp.org/routes/1203650

Is the URL (pointing to demov6) correct?

asaunier commented 4 years ago

Is the GPX that causes the problem available anywhere? We would need to get the API logs when the 500 error is thrown but I don't remember how to acces those logs ?

Example of API URL that causes a 500 error: https://api.camptocamp.org/routes/1203651?cook=fr

cbeauchesne commented 4 years ago

Is the URL (pointing to demov6) correct?

Nop, my guess is that @AntoineMarnat Antoine's file hello.py has a use_demo=true argument in bot constructor :)

AntoineMarnat commented 4 years ago

Is the URL (pointing to demov6) correct?

Nop, my guess is that @AntoineMarnat Antoine's file hello.py has a use_demo=true argument in bot constructor :)

Exactly, my bad. I updated the first post (there is still an error).

cbeauchesne commented 4 years ago

GPX file :

<?xml version="1.0" ?>
<gpx xmlns="http://www.topografix.com/GPX/1/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd" version="1.1" creator="EditGPX">
  <trk>
    <trkseg>
      <trkpt lat="47.284438" lon="4.762970">
        <ele>327.6</ele>
      </trkpt>
      <trkpt lat="47.285369" lon="4.763089">
        <ele>336.8</ele>
      </trkpt>
      <trkpt lat="47.285513" lon="4.762705">
        <ele>338.1</ele>
      </trkpt>
      <trkpt lat="47.285575" lon="4.761847">
        <ele>343.3</ele>
      </trkpt>
      <trkpt lat="47.285549" lon="4.761451">
        <ele>347</ele>
      </trkpt>
      <trkpt lat="47.286373" lon="4.760922">
        <ele>365.4</ele>
      </trkpt>
      <trkpt lat="47.286507" lon="4.760486">
        <ele>373.2</ele>
      </trkpt>
      <trkpt lat="47.286695" lon="4.760235">
        <ele>385.2</ele>
      </trkpt>
      <trkpt lat="47.286928" lon="4.760249">
        <ele>385.9</ele>
      </trkpt>
      <trkpt lat="47.287358" lon="4.759984">
        <ele>399.7</ele>
      </trkpt>
      <trkpt lat="47.287762" lon="4.759654">
        <ele>411.5</ele>
      </trkpt>
      <trkpt lat="47.288030" lon="4.759628">
        <ele>413.3</ele>
      </trkpt>
      <trkpt lat="47.289464" lon="4.760051">
        <ele>408.2</ele>
      </trkpt>
      <trkpt lat="47.289903" lon="4.760130">
        <ele>411.6</ele>
      </trkpt>
      <trkpt lat="47.290028" lon="4.760301">
        <ele>411.4</ele>
      </trkpt>
      <trkpt lat="47.290288" lon="4.760249">
        <ele>412.2</ele>
      </trkpt>
      <trkpt lat="47.290450" lon="4.760024">
        <ele>414.6</ele>
      </trkpt>
      <trkpt lat="47.290647" lon="4.759958">
        <ele>428.2</ele>
      </trkpt>
      <trkpt lat="47.290790" lon="4.760183">
        <ele>416.8</ele>
      </trkpt>
      <trkpt lat="47.291023" lon="4.760407">
        <ele>416.6</ele>
      </trkpt>
      <trkpt lat="47.291283" lon="4.760447">
        <ele>417</ele>
      </trkpt>
      <trkpt lat="47.291310" lon="4.760592">
        <ele>415.4</ele>
      </trkpt>
      <trkpt lat="47.291578" lon="4.760552">
        <ele>416</ele>
      </trkpt>
      <trkpt lat="47.291964" lon="4.760803">
        <ele>417.8</ele>
      </trkpt>
      <trkpt lat="47.292304" lon="4.760685">
        <ele>419.2</ele>
      </trkpt>
      <trkpt lat="47.292501" lon="4.760737">
        <ele>418.3</ele>
      </trkpt>
      <trkpt lat="47.292618" lon="4.760632">
        <ele>422.4</ele>
      </trkpt>
      <trkpt lat="47.293227" lon="4.760460">
        <ele>427.8</ele>
      </trkpt>
      <trkpt lat="47.293379" lon="4.760592">
        <ele>428.4</ele>
      </trkpt>
      <trkpt lat="47.293478" lon="4.760777">
        <ele>426</ele>
      </trkpt>
      <trkpt lat="47.293630" lon="4.760513">
        <ele>430.8</ele>
      </trkpt>
      <trkpt lat="47.293773" lon="4.760486">
        <ele>431.5</ele>
      </trkpt>
      <trkpt lat="47.293899" lon="4.760328">
        <ele>433.6</ele>
      </trkpt>
      <trkpt lat="47.294087" lon="4.760328">
        <ele>434.3</ele>
      </trkpt>
      <trkpt lat="47.294463" lon="4.760169">
        <ele>435</ele>
      </trkpt>
      <trkpt lat="47.294795" lon="4.759998">
        <ele>441.9</ele>
      </trkpt>
      <trkpt lat="47.295019" lon="4.759998">
        <ele>437.8</ele>
      </trkpt>
      <trkpt lat="47.295287" lon="4.759932">
        <ele>435.7</ele>
      </trkpt>
      <trkpt lat="47.295260" lon="4.760460">
        <ele>425.7</ele>
      </trkpt>
      <trkpt lat="47.295422" lon="4.760235">
        <ele>426.5</ele>
      </trkpt>
      <trkpt lat="47.295538" lon="4.759971">
        <ele>432.7</ele>
      </trkpt>
      <trkpt lat="47.295529" lon="4.759747">
        <ele>434.1</ele>
      </trkpt>
      <trkpt lat="47.295726" lon="4.759456">
        <ele>434.6</ele>
      </trkpt>
      <trkpt lat="47.295646" lon="4.758928">
        <ele>440.1</ele>
      </trkpt>
      <trkpt lat="47.295260" lon="4.758386">
        <ele>444.7</ele>
      </trkpt>
      <trkpt lat="47.295207" lon="4.757990">
        <ele>451</ele>
      </trkpt>
      <trkpt lat="47.295251" lon="4.757514">
        <ele>454.9</ele>
      </trkpt>
      <trkpt lat="47.295010" lon="4.756854">
        <ele>467</ele>
      </trkpt>
      <trkpt lat="47.295171" lon="4.756128">
        <ele>473.8</ele>
      </trkpt>
      <trkpt lat="47.295234" lon="4.755480">
        <ele>481.8</ele>
      </trkpt>
      <trkpt lat="47.295350" lon="4.755124">
        <ele>482.9</ele>
      </trkpt>
      <trkpt lat="47.295475" lon="4.754292">
        <ele>491.3</ele>
      </trkpt>
      <trkpt lat="47.295431" lon="4.753975">
        <ele>497.1</ele>
      </trkpt>
      <trkpt lat="47.295260" lon="4.753393">
        <ele>498.8</ele>
      </trkpt>
      <trkpt lat="47.295162" lon="4.753235">
        <ele>502</ele>
      </trkpt>
      <trkpt lat="47.294696" lon="4.753591">
        <ele>503.1</ele>
      </trkpt>
      <trkpt lat="47.294042" lon="4.754318">
        <ele>511.6</ele>
      </trkpt>
      <trkpt lat="47.293209" lon="4.754859">
        <ele>524.6</ele>
      </trkpt>
      <trkpt lat="47.292886" lon="4.755044">
        <ele>525.3</ele>
      </trkpt>
      <trkpt lat="47.292510" lon="4.755322">
        <ele>526.7</ele>
      </trkpt>
      <trkpt lat="47.291558" lon="4.755428">
        <ele>524</ele>
      </trkpt>
      <trkpt lat="47.292547" lon="4.755428">
        <ele>525.7</ele>
      </trkpt>
      <trkpt lat="47.292882" lon="4.756114">
        <ele>513.1</ele>
      </trkpt>
      <trkpt lat="47.292198" lon="4.756093">
        <ele>516.6</ele>
      </trkpt>
      <trkpt lat="47.292620" lon="4.756587">
        <ele>507.3</ele>
      </trkpt>
      <trkpt lat="47.291718" lon="4.756501">
        <ele>509.9</ele>
      </trkpt>
      <trkpt lat="47.292256" lon="4.757080">
        <ele>492.5</ele>
      </trkpt>
      <trkpt lat="47.291500" lon="4.757466">
        <ele>488.7</ele>
      </trkpt>
      <trkpt lat="47.290481" lon="4.757659">
        <ele>477.5</ele>
      </trkpt>
      <trkpt lat="47.289942" lon="4.757166">
        <ele>484</ele>
      </trkpt>
      <trkpt lat="47.289942" lon="4.757617">
        <ele>475.9</ele>
      </trkpt>
      <trkpt lat="47.289884" lon="4.757080">
        <ele>484.8</ele>
      </trkpt>
      <trkpt lat="47.289375" lon="4.756329">
        <ele>491.9</ele>
      </trkpt>
      <trkpt lat="47.289404" lon="4.755814">
        <ele>493.1</ele>
      </trkpt>
      <trkpt lat="47.288618" lon="4.756007">
        <ele>474.7</ele>
      </trkpt>
      <trkpt lat="47.288632" lon="4.755814">
        <ele>470.8</ele>
      </trkpt>
      <trkpt lat="47.288429" lon="4.755836">
        <ele>469</ele>
      </trkpt>
      <trkpt lat="47.288560" lon="4.755535">
        <ele>468.8</ele>
      </trkpt>
      <trkpt lat="47.288312" lon="4.755642">
        <ele>453</ele>
      </trkpt>
      <trkpt lat="47.288458" lon="4.755256">
        <ele>463.9</ele>
      </trkpt>
      <trkpt lat="47.288239" lon="4.755492">
        <ele>448</ele>
      </trkpt>
      <trkpt lat="47.288298" lon="4.755256">
        <ele>446.2</ele>
      </trkpt>
      <trkpt lat="47.288079" lon="4.755406">
        <ele>444.4</ele>
      </trkpt>
      <trkpt lat="47.288079" lon="4.755149">
        <ele>443.1</ele>
      </trkpt>
      <trkpt lat="47.287963" lon="4.755213">
        <ele>440.8</ele>
      </trkpt>
      <trkpt lat="47.288036" lon="4.754977">
        <ele>431.9</ele>
      </trkpt>
      <trkpt lat="47.287934" lon="4.755042">
        <ele>439.3</ele>
      </trkpt>
      <trkpt lat="47.288065" lon="4.754333">
        <ele>425.2</ele>
      </trkpt>
      <trkpt lat="47.288123" lon="4.754055">
        <ele>415</ele>
      </trkpt>
      <trkpt lat="47.288050" lon="4.753346">
        <ele>404.7</ele>
      </trkpt>
      <trkpt lat="47.288050" lon="4.753110">
        <ele>394.2</ele>
      </trkpt>
      <trkpt lat="47.288123" lon="4.752853">
        <ele>392.6</ele>
      </trkpt>
      <trkpt lat="47.288036" lon="4.752853">
        <ele>391.6</ele>
      </trkpt>
      <trkpt lat="47.287672" lon="4.753175">
        <ele>387.8</ele>
      </trkpt>
      <trkpt lat="47.286857" lon="4.754484">
        <ele>388.9</ele>
      </trkpt>
      <trkpt lat="47.286231" lon="4.754827">
        <ele>370.3</ele>
      </trkpt>
      <trkpt lat="47.285823" lon="4.755728">
        <ele>366.5</ele>
      </trkpt>
      <trkpt lat="47.285445" lon="4.756351">
        <ele>362.5</ele>
      </trkpt>
      <trkpt lat="47.285445" lon="4.757380">
        <ele>365.6</ele>
      </trkpt>
      <trkpt lat="47.285430" lon="4.758282">
        <ele>362.2</ele>
      </trkpt>
      <trkpt lat="47.285445" lon="4.759033">
        <ele>359.5</ele>
      </trkpt>
      <trkpt lat="47.285532" lon="4.759419">
        <ele>358.7</ele>
      </trkpt>
      <trkpt lat="47.285372" lon="4.760191">
        <ele>351.8</ele>
      </trkpt>
      <trkpt lat="47.285401" lon="4.760706">
        <ele>350.7</ele>
      </trkpt>
      <trkpt lat="47.285547" lon="4.761844">
        <ele>343</ele>
      </trkpt>
      <trkpt lat="47.285445" lon="4.762702">
        <ele>337.6</ele>
      </trkpt>
      <trkpt lat="47.285357" lon="4.763024">
        <ele>336.8</ele>
      </trkpt>
      <trkpt lat="47.284455" lon="4.762874">
        <ele>327.6</ele>
      </trkpt>
    </trkseg>
  </trk>
  <trk>
    <trkseg>
      <trkpt lat="47.293952" lon="4.760275">
        <ele>434.6</ele>
      </trkpt>
      <trkpt lat="47.293621" lon="4.760249">
        <ele>433.9</ele>
      </trkpt>
    </trkseg>
  </trk>
  <trk>
    <trkseg>
      <trkpt lat="47.295144" lon="4.753195">
        <ele>502.1</ele>
      </trkpt>
      <trkpt lat="47.295144" lon="4.753195">
        <ele>502.1</ele>
      </trkpt>
    </trkseg>
  </trk>
</gpx>