# Unknown Error, Error code 1, subcode 99

**URL:** <https://forum.mapillary.com/t/unknown-error-error-code-1-subcode-99/9379>\
**Category:** Imagery, data, and integrations\
**Created:** [March 16, 2025, 4:13pm UTC](https://forum.mapillary.com/t/unknown-error-error-code-1-subcode-99/9379 "2025-03-16T16:13:17Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![delbyte](https://avatars.discourse-cdn.com/v4/letter/d/c57346/32.png) [@delbyte](https://forum.mapillary.com/u/delbyte)\
**Post date:** [March 16, 2025, 4:13pm UTC](https://forum.mapillary.com/t/unknown-error-error-code-1-subcode-99/9379/1 "2025-03-16T16:13:17Z")

</div>

I have written a script to pull all images within a bbox- it gives me an unknown error, it being:

```Fetching
Error fetching Mapillary data: {"error":{"code":1,"message":"An unknown error occurred","error_subcode":99}}

```

I am using the `requests` module to handle the image requests.

This is the meat of my code:

```auto
url = f"https://graph.mapillary.com/images?access_token={MAPILLARY_ACCESS_TOKEN}&bbox={bbox}&fields=id,geometry"

print("Fetching image locations from Mapillary...")
response = requests.get(url)

if response.status_code == 200:
    data = response.json()
    print("Data received successfully.")

    image_coords = [(img["geometry"]["coordinates"][1], img["geometry"]["coordinates"][0]) for img in data["data"]]

    print(f"Total images found: {len(image_coords)}")

    print("Creating Folium map...")
    bologna_map = folium.Map(location=[44.4939, 11.3426], zoom_start=12)

    print("Adding markers to the map...")
    for lat, lon in image_coords:
        folium.Marker(location=[lat, lon], popup=f"Image at ({lat}, {lon})").add_to(bologna_map)

    print("Saving map as 'bologna_map.html'...")
    bologna_map.save("bologna_map.html")
    webbrowser.open("bologna_map.html")

else:
    print("Error fetching Mapillary data:", response.text)

```

There’s no documentation that I can find on Mapillary errors, hence the post.

---

<div class="post-metadata">

**Author:** ![tao](https://avatars.discourse-cdn.com/v4/letter/t/f9ae1b/32.png) [@tao](https://forum.mapillary.com/u/tao)\
**Post date:** [March 17, 2025, 5:43pm UTC](https://forum.mapillary.com/t/unknown-error-error-code-1-subcode-99/9379/2 "2025-03-17T17:43:20Z")

</div>

I wonder if it’s timeout but shown as “unknown error”. Do you see any trace ID in the error response? If timeouts, just retry with backoff.

---

<div class="post-metadata">

**Author:** ![delbyte](https://avatars.discourse-cdn.com/v4/letter/d/c57346/32.png) [@delbyte](https://forum.mapillary.com/u/delbyte)\
**Post date:** [March 17, 2025, 5:55pm UTC](https://forum.mapillary.com/t/unknown-error-error-code-1-subcode-99/9379/3 "2025-03-17T17:55:56Z")

</div>

No, it’s not timeout because I have yet to make a singular successful request to Mapillary lol

---

<div class="post-metadata">

**Author:** ![tao](https://avatars.discourse-cdn.com/v4/letter/t/f9ae1b/32.png) [@tao](https://forum.mapillary.com/u/tao)\
**Post date:** [March 17, 2025, 6:24pm UTC](https://forum.mapillary.com/t/unknown-error-error-code-1-subcode-99/9379/4 "2025-03-17T18:24:41Z")

</div>

I see. Can you reproduce the issue with curl and share me what’s in bbox={bbox}?

---

<div class="post-metadata">

**Author:** ![delbyte](https://avatars.discourse-cdn.com/v4/letter/d/c57346/32.png) [@delbyte](https://forum.mapillary.com/u/delbyte)\
**Post date:** [March 18, 2025, 1:30am UTC](https://forum.mapillary.com/t/unknown-error-error-code-1-subcode-99/9379/5 "2025-03-18T01:30:46Z")

</div>

I’m happy to tell you I fixed it.  
And I have no clue how 😃  
😭  
The thing is, before, I was using the redirect access token, then now I tried it with the Client Token (the permanent one for which you register) and now it worked! I didn’t change a singular line of code apart from that, so I can only assume it was that.  
Thank you so much for staying here though, some emotional support was provided hahah

---

<div class="post-metadata">

**Author:** ![delbyte](https://avatars.discourse-cdn.com/v4/letter/d/c57346/32.png) [@delbyte](https://forum.mapillary.com/u/delbyte)\
**Post date:** [March 18, 2025, 3:20pm UTC](https://forum.mapillary.com/t/unknown-error-error-code-1-subcode-99/9379/6 "2025-03-18T15:20:15Z")

</div>

@tao  
It’s not working anymore. And I changed nothing, now I have actually zero clue what was causing the problem. I used dotenv to put my client token into an env file before pushing to github, and it broke  
I have no clue what this is please help

At least it gives me a different error now-

```auto
Error fetching Mapillary data: {"error":{"message":"Invalid OAuth access token - Cannot parse access token","type":"OAuthException","code":190,"fbtrace_id":"AMrao4GF-xPnVPIyjwpEn4A"}}

```

If I _don’t_ use .env however, and just have my client token in the file, it will execute just alright.  
I have no clue why this is happening and yeah I can work with it, but I WOULD like not to push my client token to github. Though it should probably be fine.

---

<div class="post-metadata">

**Author:** ![tao](https://avatars.discourse-cdn.com/v4/letter/t/f9ae1b/32.png) [@tao](https://forum.mapillary.com/u/tao)\
**Post date:** [March 18, 2025, 9:45pm UTC](https://forum.mapillary.com/t/unknown-error-error-code-1-subcode-99/9379/7 "2025-03-18T21:45:46Z")

</div>

It looks like the `access_token=?` passed in is invalid. Can you make sure it’s your app’s Client Token, i.e. `MLY|xxx|yyy`, or user’s access token?

To debug similar issues, I’d suggest print out the whole url first, and then use `curl` command to make the equivalent http request:

```auto
curl -v "https://graph.mapillary.com/images?access_token={MAPILLARY_ACCESS_TOKEN}&bbox={bbox}&fields=id,geometry"

```

and hopefully to find the root cause.

---

<div class="post-metadata">

**Author:** ![delbyte](https://avatars.discourse-cdn.com/v4/letter/d/c57346/32.png) [@delbyte](https://forum.mapillary.com/u/delbyte)\
**Post date:** [March 19, 2025, 12:33am UTC](https://forum.mapillary.com/t/unknown-error-error-code-1-subcode-99/9379/8 "2025-03-19T00:33:12Z")

</div>

It is my client’s access token. I will try to debug when I can, but my work with Mapillary seems to be mostly done 🙂  
Thank you so much for sticking by!
