go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
43.82k stars 5.38k forks source link

Missing avatar / broken url link after re-installation #31075

Closed khanumballz closed 3 days ago

khanumballz commented 3 months ago

Description

I have no idea what I did wrong, or how to work around this. ./gitea doctor shows all working paths OK.

Screenshot_20240525_133959

app.ini

[1] Check paths and basic configuration

2024/05/25 13:46:24 ...s/graceful/server.go:50:NewServer() [I] Starting new Web server: tcp:0.0.0.0:3000 on PID: 16158 2024/05/25 13:47:18 ...eb/routing/logger.go:102:func1() [I] router: completed GET /khanumballz for 127.0.0.1:58920, 200 OK in 20.4ms @ user/home.go:713(user.UsernameSubRoute) 2024/05/25 13:47:18 routers/web/base.go:80:func2() [W] Unable to find avatars d94438e78ed6e2a09b4d25eb9a20587e 2024/05/25 13:47:18 ...eb/routing/logger.go:102:func1() [I] router: completed GET /avatars/d94438e78ed6e2a09b4d25eb9a20587e?size=512 for 127.0.0.1:58920, 404 Not Found in 0.1ms @ web/base.go:22(avatars) 2024/05/25 13:47:25 routers/web/base.go:80:func2() [W] Unable to find avatars d94438e78ed6e2a09b4d25eb9a20587e 2024/05/25 13:47:25 ...eb/routing/logger.go:102:func1() [I] router: completed GET /avatars/d94438e78ed6e2a09b4d25eb9a20587e?size=512 for 127.0.0.1:58920, 404 Not Found in 0.2ms @ web/base.go:22(avatars) 2024/05/25 13:47:25 ...eb/routing/logger.go:102:func1() [I] router: completed GET /favicon.ico for 127.0.0.1:58920, 301 Moved Permanently in 0.2ms @ misc/misc.go:46(web.Routes.StaticRedirect)

Gitea Version

Gitea version: 1.23.0+dev-125-gec771fdfcd built with GNU Make 4.3, go1.22.3 : bindata, sqlite, sqlite_unlock_notify

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Built from source Arm64

Database

SQLite

lunny commented 3 months ago

How did you re-install?

yp05327 commented 2 months ago

avatars are saved in {data path}/avatars, maybe you need to check the files in this folder.

alyandon commented 2 months ago

I appear to have the same issue after upgrading to 1.22.0 from 1.21.7. data/avatar directory is empty and attempting to force the download does not appear to do anything. Gitea is configured with default Gravatar source.

Edit: Also, the profile in question didn't actually have a gravatar so was relying on the identicon generator. I tried to assign an actual image to the gravatar profile and that didn't work either. Uploading an image via web browser works.

alyandon commented 2 months ago

Some logs:

2024/05/29 16:22:21 routers/web/base.go:80:func2() [W] Unable to find avatars 9e61922cdffba0bcee9a3c5552ba7513
2024/05/29 16:22:21 routers/web/base.go:80:func2() [W] Unable to find avatars 9e61922cdffba0bcee9a3c5552ba7513
2024/05/29 16:22:21 ...eb/routing/logger.go:102:func1() [I] router: completed GET /avatars/9e61922cdffba0bcee9a3c5552ba7513?size=512 for [IPV6_ADDR_REMOVED]:0, 404 Not Found in 0.1ms @ web/base.go:22(avatars)
2024/05/29 16:22:21 ...eb/routing/logger.go:102:func1() [I] router: completed GET /avatars/9e61922cdffba0bcee9a3c5552ba7513?size=48 for [IPV6_ADDR_REMOVED]:0, 404 Not Found in 0.2ms @ web/base.go:22(avatars)
alyandon commented 2 months ago

Both identicons and custom gravatar avatars aren't working. Manually uploading a gif|jpg|png to my profile appears to work fine.

yp05327 commented 2 months ago

So you are using gravatar avatars, but it seems that all avatar URLs are accessing Gitea instance not gravatar server.

IIRC, the following settings will be cached in DB, maybe on/off it can update the settings. Not sure whether this will work, but can have a try. image

alyandon commented 2 months ago

Toggling it by itself didn't appear to actually help. I managed to get my identicon to show up by doing the following:

1) Disable Gravatar in settings. 2) Go into my user profile settings 3) Noticed the "delete current avatar" button is enabled even though technically I don't have one. 4) Pressed "delete current avatar" and immediately my identicon avatar displayed as expected. 5) Re-enabled Gravatar in settings.

Actual Gravatars don't appear to show up though. I switched to another user that does have a custom Gravatar associated with the profile email address and Gitea displays an identicon instead of the avatar.

yp05327 commented 2 months ago

As @lunny asked above, we don't know how you reinstalled your Gitea instance, so it is hard to say this is a bug from Gitea.

Maybe reset the avatar email can be helpful?

khanumballz commented 2 months ago

Hi again.

The problem isn't the custom uploaded avatars, but the generic ones that get automatically generated.

I still haven't found the issue, because the avatar folder is empty by default, so it seems to be some kind of vector graphics code written somewhere in the js I suppose.

More info:

I have built gitea form source on arm64 orange pi 5 plus. Everything else works fine

rdmcguire commented 2 months ago

This is also broken for me immediately following upgrade to 1.22.0 -- gravatar no longer works. I didn't have any custom avatars, only gravatar. The disable slider is off (it was on following the upgrade), but it still doesn't work.

I am also being asked to reset my password after authenticating with my oidc provider, so there seems to be some account functionality broken after the upgrade though I doubt it's related.

Installed via helm chart gitea-10.2.0.

rdmcguire commented 2 months ago

Per the 1.22 release notes, server.OFFLINE_MODE is now set to true by default. This seems to break gravatar functionality even if the disable slider is off. Setting server.OFFLINE_MODE=false in my k8s secret and rollout restarting the deployment restored gravatar functionaly for me.

alyandon commented 2 months ago

Same here. As soon as I changed the setting to false and restarted gitea my actual gravatar immediately appeared in place of the identicon.

sbuller commented 1 month ago

This bit me too. I'm using the gitea/gitea container, and all our avatars were broken by the 1.22 update. We'd had nothing but the auto generated geometric patterns, so I went through and used the 'Delete Avatar' button on all the accounts to fix things.

yp05327 commented 1 month ago

I can image two cases which can cause this issue:

But as many reports above are updating, so the first case is the most possible case I think.

sbuller commented 1 month ago

For context I can add that my installation has been through various stages. It started out as gogs, running on a VM. It was upgraded in place to gitea. More recently it was converted to a container. The latest update was from container version 1.21.11 to container version 1.22.

I guess the gravatar setting might contribute - I never had it disabled - but as far as I could tell it wasn't contributing anything.

GiteaBot commented 3 days ago

We close issues that need feedback from the author if there were no new comments for a month. :tea: