[BUG] Uploading with Mapbox enabled breaks all metadata #162

Closed
opened 2026-02-04 18:17:02 +03:00 by OVERLORD · 12 comments
Owner

Originally created by @pluja on GitHub (Jul 30, 2022).

Describe the bug

I was testing to enable Mapbox for reverse geocoding. Once enabled (ENABLE_MAPBOX=true), I noticed that any images that I was uploading after activating Mapbox didn't have any metadata (on the webUI and phone app). Maybe the API key was in the wrong format?

API key format I used:
MAPBOX_KEY=pk.e*****************************************************************************_D***

The same happened if the images were either uploaded from the app or from immich-cli

System

  • Phone OS [iOS, Android]: Graphene OS (Android 12)
  • Server Version: v1.19.0
  • Mobile App Version: v1.19.0 build.29
Originally created by @pluja on GitHub (Jul 30, 2022). <!-- Note: Please search to see if an issue already exists for the bug you encountered. --> **Describe the bug** I was testing to enable Mapbox for reverse geocoding. Once enabled (ENABLE_MAPBOX=true), I noticed that any images that I was uploading after activating Mapbox didn't have any metadata (on the webUI and phone app). Maybe the API key was in the wrong format? API key format I used: `MAPBOX_KEY=pk.e*****************************************************************************_D***` The same happened if the images were either uploaded from the app or from immich-cli **System** - Phone OS [iOS, Android]: `Graphene OS (Android 12)` - Server Version: `v1.19.0` - Mobile App Version: `v1.19.0 build.29`
Author
Owner

@alextran1502 commented on GitHub (Jul 30, 2022):

When you first upload, the metadata extraction job will run at a later time as they are put into a queue system. If you upload 4000 images, you will have to wait for a while because all the background jobs will take turns running so the server won't be choked by heavy CPU usage. Can you please check again?

@alextran1502 commented on GitHub (Jul 30, 2022): When you first upload, the metadata extraction job will run at a later time as they are put into a queue system. If you upload 4000 images, you will have to wait for a while because all the background jobs will take turns running so the server won't be choked by heavy CPU usage. Can you please check again?
Author
Owner

@alextran1502 commented on GitHub (Jul 30, 2022):

If possible, can you try to upload a small set of images first? Also, did you restart the containers after you added in the Mapbox key?

@alextran1502 commented on GitHub (Jul 30, 2022): If possible, can you try to upload a small set of images first? Also, did you restart the containers after you added in the Mapbox key?
Author
Owner

@pluja commented on GitHub (Jul 30, 2022):

@alextran1502 thank you for helping. Yes, I was restarting all my containers.

I just turned on mapbox again and added my key. I made a single photo (making sure it had location metadata) and uploaded it via Android App (automatic backup). After waiting for at least 15 minutes, the result was "No exif metadata available".

I turned all containers down, disabled Mapbox form the .env and turned up again. I took the same photo again, and uploaded it. With Mapbox disabled I am getting this:

And the photo I uploaded before does also show the metadata now that MAPBOX is disabled. From my mapbox statistics page, I see that there is no activity with the key.

My Mapbox configuration in the .env:

# ENABLE_MAPBOX is either true of false -> if true, you have to provide MAPBOX_KEY
ENABLE_MAPBOX=true
MAPBOX_KEY=pk.ey**********************************************************************************************A

I tested setting a wrong key, and it errors "Error: Invalid token" from microservices so the token is being detected and used.

@pluja commented on GitHub (Jul 30, 2022): @alextran1502 thank you for helping. Yes, I was restarting all my containers. I just turned on mapbox again and added my key. I made a single photo (making sure it had location metadata) and uploaded it via Android App (automatic backup). After waiting for at least 15 minutes, the result was "No exif metadata available". ![](https://i.bcow.xyz/bjnvQPh.png) I turned all containers down, disabled Mapbox form the .env and turned up again. I took the same photo again, and uploaded it. With Mapbox disabled I am getting this: ![](https://rimgo.bus-hit.me/Rzh4SEk.png) And the photo I uploaded before does also show the metadata now that MAPBOX is disabled. From my mapbox statistics page, I see that there is no activity with the key. My Mapbox configuration in the `.env`: ``` # ENABLE_MAPBOX is either true of false -> if true, you have to provide MAPBOX_KEY ENABLE_MAPBOX=true MAPBOX_KEY=pk.ey**********************************************************************************************A ``` I tested setting a wrong key, and it errors "Error: Invalid token" from `microservices` so the token is being detected and used.
Author
Owner

@alextran1502 commented on GitHub (Jul 30, 2022):

So I guess your Mapbox key is invalid? Can you try generate a new key and use the new one instead?

@alextran1502 commented on GitHub (Jul 30, 2022): So I guess your Mapbox key is invalid? Can you try generate a new key and use the new one instead?
Author
Owner

@pluja commented on GitHub (Jul 30, 2022):

The key I am using is a valid key.

I meant that I tested making the key wrong on purpose to see if Immich was using the key at all. But when I put a wrong key on purpose it says "Error: Invalid token", which is OK because it means that Immich is in fact detecting that I am using a wrong key.

My key, otherwise, does not output any errors, but still the metadata of the uploaded media is not shown for some reason.

@pluja commented on GitHub (Jul 30, 2022): The key I am using is a valid key. I meant that I tested making the key wrong on purpose to see if Immich was using the key at all. But when I put a wrong key on purpose it says "Error: Invalid token", which is OK because it means that Immich is in fact detecting that I am using a wrong key. My key, otherwise, does not output any errors, but still the metadata of the uploaded media is not shown for some reason.
Author
Owner

@alextran1502 commented on GitHub (Jul 30, 2022):

Is there is a file that you are comfortable sharing that I can use to test it?

@alextran1502 commented on GitHub (Jul 30, 2022): Is there is a file that you are comfortable sharing that I can use to test it?
Author
Owner

@pluja commented on GitHub (Jul 31, 2022):

You mean an image file? It happens with all files on my library. When I enable Mapbox they all loose the EXIF information tab, when I re-enable it, they all get it again. I will try to make a screenshot video later.

@pluja commented on GitHub (Jul 31, 2022): You mean an image file? It happens with all files on my library. When I enable Mapbox they all loose the EXIF information tab, when I re-enable it, they all get it again. I will try to make a screenshot video later.
Author
Owner

@alextran1502 commented on GitHub (Jul 31, 2022):

One possibility I can think of is there is a white space after the key in
the .env file. Can you help check if it terminate correctly?

On Sat, Jul 30, 2022 at 4:20 PM pluja @.***> wrote:

You mean an image file? It happens with all files on my library. When I
enable Mapbox they all loose the EXIF information tab, when I re-enable it,
they all get it again. I will try to make a screenshot video later.


Reply to this email directly, view it on GitHub
https://github.com/immich-app/immich/issues/394#issuecomment-1200296103,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AGONL7ULO47ELN37VIFV6ZLVWWMC3ANCNFSM55CETHNQ
.
You are receiving this because you were mentioned.Message ID:
@.***>

@alextran1502 commented on GitHub (Jul 31, 2022): One possibility I can think of is there is a white space after the key in the .env file. Can you help check if it terminate correctly? On Sat, Jul 30, 2022 at 4:20 PM pluja ***@***.***> wrote: > You mean an image file? It happens with all files on my library. When I > enable Mapbox they all loose the EXIF information tab, when I re-enable it, > they all get it again. I will try to make a screenshot video later. > > — > Reply to this email directly, view it on GitHub > <https://github.com/immich-app/immich/issues/394#issuecomment-1200296103>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AGONL7ULO47ELN37VIFV6ZLVWWMC3ANCNFSM55CETHNQ> > . > You are receiving this because you were mentioned.Message ID: > ***@***.***> >
Author
Owner

@pluja commented on GitHub (Jul 31, 2022):

Ok. I found what was causing this issue:

When I set up Mapbox, I created a new token specifically for Immich. It seems that this token is not working. If I use the "Default public token" it works perfectly. I checked and the allowed scopes are exactly the same on both tokens, also NO restricted URLs are set up.

It's weird, but I think this is the solution; use the default public token instead of creating one specifically for immich... :/

@pluja commented on GitHub (Jul 31, 2022): Ok. I found what was causing this issue: When I set up Mapbox, I created a new token specifically for Immich. It seems that this token is not working. If I use the "Default public token" it works perfectly. I checked and the allowed scopes are exactly the same on both tokens, also NO restricted URLs are set up. It's weird, but I think this is the solution; use the default public token instead of creating one specifically for immich... :/
Author
Owner

@alextran1502 commented on GitHub (Jul 31, 2022):

Hmm interesting, probably scoping issue when creating the token. We inly use the reverse geocoding or searching by Mapbox's definition, so maybe there is an option for that when creating the token.

Edit: I saw you also check the scope. Weird, when I have the time, I will take a look at Mapbox

@alextran1502 commented on GitHub (Jul 31, 2022): Hmm interesting, probably scoping issue when creating the token. We inly use the reverse geocoding or searching by Mapbox's definition, so maybe there is an option for that when creating the token. Edit: I saw you also check the scope. Weird, when I have the time, I will take a look at Mapbox
Author
Owner

@akoyaxd commented on GitHub (Aug 27, 2022):

Hey, I have the exact same problem. The default public token from Mapbox works but a separate token did not work.
I'm happy to share further details if needed.

Btw. Immich is a super awesome app. I was looking for something like (Basicly Google Photos alternative) this for years!! It's a real game changer for me.
Keep going the good work!

Edit: Maybe adding a note in the documentation to use the public token for now would really help. Without this issue I would have been lost with this problem.

@akoyaxd commented on GitHub (Aug 27, 2022): Hey, I have the exact same problem. The default public token from Mapbox works but a separate token did not work. I'm happy to share further details if needed. Btw. Immich is a super awesome app. I was looking for something like (Basicly Google Photos alternative) this for years!! It's a real game changer for me. Keep going the good work! Edit: Maybe adding a note in the documentation to use the public token for now would really help. Without this issue I would have been lost with this problem.
Author
Owner

@alextran1502 commented on GitHub (Aug 27, 2022):

@akoyaxd I think it has to do with the permission of the separated token. I haven't tested which permission does the token need to work.

Also, thank you for the kind words! I and the team appreciate it

@alextran1502 commented on GitHub (Aug 27, 2022): @akoyaxd I think it has to do with the permission of the separated token. I haven't tested which permission does the token need to work. Also, thank you for the kind words! I and the team appreciate it
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#162