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

feat(storage): Add options to skip version check for Minio storage to resolve compatible problem #33166

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

xiandan-erizo
Copy link

I encountered an error while using Tencent COS object storage. The logs are as follows, and it seems incompatible. According to the relevant code comments, I found that this can be skipped.

(⎈|sre:gitea) ~ k logs -f gitea-5579b4fd6f-p4sms                         
Defaulted container "gitea" out of: gitea, init-directories (init), init-app-ini (init), configure-gitea (init)
Error from server (BadRequest): container "gitea" in pod "gitea-5579b4fd6f-p4sms" is waiting to start: PodInitializing
(⎈|sre:gitea) ~ k logs -f gitea-5579b4fd6f-p4sms
Defaulted container "gitea" out of: gitea, init-directories (init), init-app-ini (init), configure-gitea (init)
2025/01/08 06:00:42 cmd/web.go:242:runWeb() [I] Starting Gitea on PID: 7
2025/01/08 06:00:42 cmd/web.go:111:showWebStartupMessage() [I] Gitea version: 1.22.3 built with GNU Make 4.4.1, go1.22.8 : bindata, timetzdata, sqlite, sqlite_unlock_notify
2025/01/08 06:00:42 cmd/web.go:112:showWebStartupMessage() [I] * RunMode: prod
2025/01/08 06:00:42 cmd/web.go:113:showWebStartupMessage() [I] * AppPath: /usr/local/bin/gitea
2025/01/08 06:00:42 cmd/web.go:114:showWebStartupMessage() [I] * WorkPath: /data
2025/01/08 06:00:42 cmd/web.go:115:showWebStartupMessage() [I] * CustomPath: /data/gitea
2025/01/08 06:00:42 cmd/web.go:116:showWebStartupMessage() [I] * ConfigFile: /data/gitea/conf/app.ini
2025/01/08 06:00:42 cmd/web.go:117:showWebStartupMessage() [I] Prepare to run web server
2025/01/08 06:00:42 routers/init.go:116:InitWebInstalled() [I] Git version: 2.45.2 (home: /data/home)
2025/01/08 06:00:42 ...s/setting/session.go:77:loadSessionFrom() [I] Session Service Enabled
2025/01/08 06:00:42 ...s/storage/storage.go:176:initAttachments() [I] Initialising Attachment storage with type: minio
2025/01/08 06:00:42 ...les/storage/minio.go:86:NewMinioStorage() [I] Creating Minio storage at *******.myqcloud.com:gitea with base path attachments/
2025/01/08 06:00:42 routers/init.go:64:mustInit() [F] code.gitea.io/gitea/modules/storage.Init failed: expected element type <VersioningConfiguration> but have <CreateBucketConfiguration>
image

it worked now

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jan 9, 2025
@pull-request-size pull-request-size bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jan 9, 2025
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label Jan 9, 2025
@yp05327
Copy link
Contributor

yp05327 commented Jan 9, 2025

Please use English for the title. Thanks.

@yp05327 yp05327 added type/docs This PR mainly updates/creates documentation and removed type/docs This PR mainly updates/creates documentation labels Jan 9, 2025
@yp05327
Copy link
Contributor

yp05327 commented Jan 9, 2025

Wait, the fix seems not correct. It seems that the root reason is not from this place.

According to the document, GetBucketVersioning is supported.
image

According to the document, GetBucketVersioning will return VersioningConfiguration

But the error log is expected element type <VersioningConfiguration> but have <CreateBucketConfiguration>???

@lunny lunny changed the title feat(storage): 为 Minio 存储添加版本检查跳过选项 feat(storage): Add options to skip version check for Minio storage to resolve compatible problem Jan 9, 2025
@xiandan-erizo
Copy link
Author

xiandan-erizo commented Jan 10, 2025

Wait, the fix seems not correct. It seems that the root reason is not from this place.

According to the document, GetBucketVersioning is supported. image

According to the document, GetBucketVersioning will return VersioningConfiguration

But the error log is expected element type <VersioningConfiguration> but have <CreateBucketConfiguration>???

yes, this is my config.

  config:
    #  APP_NAME: "Gitea: Git with a cup of tea"
    #  RUN_MODE: dev
    server:
      SSH_PORT: 22 # rootful image
      SSH_LISTEN_PORT: 2222 # rootless image
      LFS_START_SERVER: true
    attachment:
      STORAGE_TYPE: minio
    avatar:
      STORAGE_TYPE: minio
    lfs:
      STORAGE_TYPE: minio
    picture:
      AVATAR_STORAGE_TYPE: minio
    "storage.packages":
      STORAGE_TYPE: minio
    repo-archive:
      STORAGE_TYPE: minio
    
    storage.minio:
      MINIO_ENDPOINT: ***********cos.ap-beijing.myqcloud.com
      MINIO_LOCATION: ap-beijing
      MINIO_ACCESS_KEY_ID: AK
      MINIO_SECRET_ACCESS_KEY: SK
      MINIO_USE_SSL: true
      MINIO_BUCKET_LOOKUP: dns

and this is log. my image is gitea/gitea:1.22.3-rootless
image

And I change this version control from COS. However, opening or closing it always fails.
image

@yp05327
Copy link
Contributor

yp05327 commented Jan 10, 2025

I don't have Tentent Cloud environment to test it deeply. Maybe you can change the log level to trace, and run mode to dev, to get more logs.

It seems that this version check is for checking whether the config is correct, so skipping it not seems good (IMO).
Also, I can not understand why skipping it can fix it... More details should be provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/go Pull requests that update Go code size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants