Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After upgrading Gitea to the latest version, the actions secrets are lost #33535

Open
ysicing opened this issue Feb 8, 2025 · 10 comments · May be fixed by #33556
Open

After upgrading Gitea to the latest version, the actions secrets are lost #33535

ysicing opened this issue Feb 8, 2025 · 10 comments · May be fixed by #33556
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail type/bug

Comments

@ysicing
Copy link
Contributor

ysicing commented Feb 8, 2025

Description

After upgrading Gitea to the latest version, the pipeline keys are lost, but the database records are still present.

Gitea Version

1.23.3

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

Image

Image

Image

Image

Image

The screenshots show my YAML configuration and the historical execution records, which were working fine before the upgrade. After the upgrade, I found that the environment variables are missing, so I manually added one. Finally, there is a screenshot of the database.

Git Version

No response

Operating System

docker

How are you running Gitea?

docker compose

Database

MySQL/MariaDB

@ysicing ysicing changed the title After upgrading Gitea to the latest version, the pipeline keys are lost After upgrading Gitea to the latest version, the actions secrets are lost Feb 8, 2025
@lunny
Copy link
Member

lunny commented Feb 8, 2025

Please check whether you changed the security key in the app.ini.

@lunny lunny added the issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail label Feb 8, 2025
@ysicing
Copy link
Contributor Author

ysicing commented Feb 8, 2025

I checked the app.ini file, and the last change was on July 28, 2024.

Image

@ysicing
Copy link
Contributor Author

ysicing commented Feb 8, 2025

But I noticed that the value of security.SECRET_KEY seems to be empty. How should I fix this? There are hundreds of repositories! 😂

[security]
INSTALL_LOCK = true
SECRET_KEY =
REVERSE_PROXY_LIMIT = 1
REVERSE_PROXY_TRUSTED_PROXIES = *

@lunny
Copy link
Member

lunny commented Feb 8, 2025

If it's empty, a default value will be given and the code hasn't been changed in two years.

@techknowlogick
Copy link
Member

Which version did you upgrade from?

@ysicing
Copy link
Contributor Author

ysicing commented Feb 9, 2025

There was no problem in version 1.22. This issue did not exist before the upgrade, and this Gitea service has been running for quite a while. The recent upgrade path is as follows:

Image

You look at the database records. The owner of version 1.22 is 11, which is the organization ID. After upgrading to version 1.23, the value here is changed to 0.

Image

@lunny
Copy link
Member

lunny commented Feb 9, 2025

There was no problem in version 1.22. This issue did not exist before the upgrade, and this Gitea service has been running for quite a while. The recent upgrade path is as follows:

Image

You look at the database records. The owner of version 1.22 is 11, which is the organization ID. After upgrading to version 1.23, the value here is changed to 0.

Image

OK. Maybe that's the bug? maybe caused by #31724 @wolfogre

@lunny
Copy link
Member

lunny commented Feb 9, 2025

As a workaround, maybe update all owner_id = 0 if repo_id > 0 manually. Please backup this table before you do any operations.

@ysicing
Copy link
Contributor Author

ysicing commented Feb 11, 2025

@wolfogre Is there any time you can take a look at this issue?

@wolfogre
Copy link
Member

wolfogre commented Feb 11, 2025

Yes, it is caused by #31724, but it's not a bug; it's by design.

Image

Due to the special nature of secrets, I would rather choose to let Gitea forget some secrets as dirty data (which may bring some inconsistencies, sorry about that) than to let the secrets leak.

@ysicing So please update the database table manually, or recreate those secrets.

@lunny Maybe we can have a doctor tool to fix those dirty data, {OwnerID: x, RepoID: y} -> {OwnerID: 0, RepoID: y}

@lunny lunny linked a pull request Feb 11, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants