Impossible to upgrade forgejo, curl returns an 401 error

My YunoHost server

Hardware: VPS online
YunoHost version: 11.2.9.1
I have access to my server : Through SSH | through the webadmin |
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no

Description of my issue

I have a working forgejo 1.21.3-0~ynh1

Version 1.21.4-0~ynh1 is now available and I’ve tried to update through the web interface as well as with terminal

It does not work, it shows a
2024-01-25 18:39:53,458: DEBUG - + curl --url https://domain2.tld//api/v1/admin/cron/sync_external_users -X POST -H ‘Authorization: token 57645ed98c295a7af727ac4bcafcdbb2ce7e1fd7’ -kfsS
2024-01-25 18:39:53,490: WARNING - curl: (22) The requested URL returned error: 401
and then fails and reverts to the former version

here is the full log https://paste.yunohost.org/raw/tozifojiba

Not sure why it doesn’t work but be very careful because you just shared an admin token in the log you shared …

The good news is that maybe the very reason the upgrade crash is because the token ain’t valid, but I don’t know enough details about how forgejo works (and also we don’t know what’s your domain name because it’s redacted - which is good)

you can regenerate a token using:

sudo -u forgejo /var/www/forgejo/forgejo admin user generate-access-token --username yunohost_api --token-name "admin" --scopes "write:admin" --raw | tail -1

and replace the old one with:
yunohost app setting forgejo forgejo_api_token -v YOUR_NEW_TOKEN

IT WORKED ! :sparkler:

Thank you so much

1 Like

:tada: ^w^

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.