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

routers/init.go:64:mustInit() [F] code.gitea.io/gitea/modules/storage.Init failed: Endpoint: does not follow ip address or domain name standards. #32931

Closed
seepine opened this issue Dec 20, 2024 · 6 comments
Labels
type/bug type/docs This PR mainly updates/creates documentation
Milestone

Comments

@seepine
Copy link

seepine commented Dec 20, 2024

Description

app.ini

[storage]
STORAGE_TYPE = minio

MINIO_ENDPOINT = 192.168.2.5:9010
MINIO_ACCESS_KEY_ID = r3lyxxxxxxqCjRr
MINIO_SECRET_ACCESS_KEY = nEQ9xxxxxxxxiNfGr
MINIO_BUCKET = gitea
MINIO_LOCATION = china-1

MINIO_USE_SSL = false
MINIO_INSECURE_SKIP_VERIFY = true
SERVE_DIRECT = true


[lfs]
STORAGE_TYPE = minio

[picture]
AVATAR_STORAGE_TYPE = minio

[repo-archive]
STORAGE_TYPE = minio

[actions]
STORAGE_TYPE = minio

And restart gitea server got error log

2024/12/20 21:07:34 cmd/web.go:242:runWeb() [I] Starting Gitea on PID: 7

2024/12/20 21:07:34 cmd/web.go:111:showWebStartupMessage() [I] Gitea version: 1.22.6 built with GNU Make 4.4.1, go1.22.10 : bindata, timetzdata, sqlite, sqlite_unlock_notify

2024/12/20 21:07:34 cmd/web.go:112:showWebStartupMessage() [I] * RunMode: prod

2024/12/20 21:07:34 cmd/web.go:113:showWebStartupMessage() [I] * AppPath: /usr/local/bin/gitea

2024/12/20 21:07:34 cmd/web.go:114:showWebStartupMessage() [I] * WorkPath: /var/lib/gitea

2024/12/20 21:07:34 cmd/web.go:115:showWebStartupMessage() [I] * CustomPath: /var/lib/gitea/custom

2024/12/20 21:07:34 cmd/web.go:116:showWebStartupMessage() [I] * ConfigFile: /etc/gitea/app.ini

2024/12/20 21:07:34 cmd/web.go:117:showWebStartupMessage() [I] Prepare to run web server

2024/12/20 21:07:34 routers/init.go:116:InitWebInstalled() [I] Git version: 2.45.2 (home: /var/lib/gitea/home)

2024/12/20 21:07:34 ...s/setting/session.go:77:loadSessionFrom() [I] Session Service Enabled

2024/12/20 21:07:34 ...s/storage/storage.go:176:initAttachments() [I] Initialising Attachment storage with type: minio

2024/12/20 21:07:34 ...les/storage/minio.go:86:NewMinioStorage() [I] Creating Minio storage at 192.168.2.5:9010:gitea with base path attachments/

2024/12/20 21:07:34 ...s/storage/storage.go:166:initAvatars() [I] Initialising Avatar storage with type: minio

2024/12/20 21:07:34 ...les/storage/minio.go:86:NewMinioStorage() [I] Creating Minio storage at 192.168.2.5:9010:gitea with base path avatars/

2024/12/20 21:07:34 ...s/storage/storage.go:192:initRepoAvatars() [I] Initialising Repository Avatar storage with type: minio

2024/12/20 21:07:34 ...les/storage/minio.go:86:NewMinioStorage() [I] Creating Minio storage at 192.168.2.5:9010:gitea with base path repo-avatars/

2024/12/20 21:07:34 ...s/storage/storage.go:186:initLFS() [I] Initialising LFS storage with type: minio

2024/12/20 21:07:34 ...les/storage/minio.go:86:NewMinioStorage() [I] Creating Minio storage at : with base path lfs/

2024/12/20 21:07:34 routers/init.go:64:mustInit() [F] code.gitea.io/gitea/modules/storage.Init failed: Endpoint:  does not follow ip address or domain name standards.

Gitea Version

gitea/gitea:1.22.6-rootless

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

docker rootless

Database

PostgreSQL

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Dec 20, 2024

It is a bug, you could try to use [storage.lfs] instead to inherit

@wxiaoguang wxiaoguang added this to the 1.23.0 milestone Dec 20, 2024
@seepine
Copy link
Author

seepine commented Dec 20, 2024

Yes, the [storage.minio] can work

image

@lunny
Copy link
Member

lunny commented Dec 20, 2024

I don't think it's a bug.
If you design like the below.

[storage]
STORAGE_TYPE = minio

MINIO_ENDPOINT = 192.168.2.5:9010
MINIO_ACCESS_KEY_ID = r3lyxxxxxxqCjRr
MINIO_SECRET_ACCESS_KEY = nEQ9xxxxxxxxiNfGr
MINIO_BUCKET = gitea
MINIO_LOCATION = china-1

MINIO_USE_SSL = false
MINIO_INSECURE_SKIP_VERIFY = true
SERVE_DIRECT = true

This is a default storage for all other storage sections, so you don't need to do anything in your other sections.

[lfs]
// just leave blank for STORAGE_TYPE

If you have multiple storage configurations, one is like below.

[storage.my_cfg]
STORAGE_TYPE = minio

MINIO_ENDPOINT = 192.168.2.5:9010
MINIO_ACCESS_KEY_ID = r3lyxxxxxxqCjRr
MINIO_SECRET_ACCESS_KEY = nEQ9xxxxxxxxiNfGr
MINIO_BUCKET = gitea
MINIO_LOCATION = china-1

MINIO_USE_SSL = false
MINIO_INSECURE_SKIP_VERIFY = true
SERVE_DIRECT = true
[lfs]
STORAGE_TYPE = my_cfg

You can not mix the two usages.

But I think the error message should be more friendly.

@seepine
Copy link
Author

seepine commented Dec 21, 2024

I don't think it's a bug. If you design like the below.

[storage]
STORAGE_TYPE = minio

MINIO_ENDPOINT = 192.168.2.5:9010
MINIO_ACCESS_KEY_ID = r3lyxxxxxxqCjRr
MINIO_SECRET_ACCESS_KEY = nEQ9xxxxxxxxiNfGr
MINIO_BUCKET = gitea
MINIO_LOCATION = china-1

MINIO_USE_SSL = false
MINIO_INSECURE_SKIP_VERIFY = true
SERVE_DIRECT = true

This is a default storage for all other storage sections, so you don't need to do anything in your other sections.

[lfs]
// just leave blank for STORAGE_TYPE

If you have multiple storage configurations, one is like below.

[storage.my_cfg]
STORAGE_TYPE = minio

MINIO_ENDPOINT = 192.168.2.5:9010
MINIO_ACCESS_KEY_ID = r3lyxxxxxxqCjRr
MINIO_SECRET_ACCESS_KEY = nEQ9xxxxxxxxiNfGr
MINIO_BUCKET = gitea
MINIO_LOCATION = china-1

MINIO_USE_SSL = false
MINIO_INSECURE_SKIP_VERIFY = true
SERVE_DIRECT = true
[lfs]
STORAGE_TYPE = my_cfg

You can not mix the two usages.

But I think the error message should be more friendly.

Thanks, your configuration examples are very clear.
But the examples in the document are prone to cause misunderstanding.

image image

@lunny
Copy link
Member

lunny commented Dec 22, 2024

I sent https://gitea.com/gitea/docs/pulls/131 to update the related documentations.

@lunny lunny added the type/docs This PR mainly updates/creates documentation label Dec 22, 2024
@lunny
Copy link
Member

lunny commented Dec 28, 2024

Closed as https://gitea.com/gitea/docs/pulls/131 merged.

@lunny lunny closed this as completed Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug type/docs This PR mainly updates/creates documentation
Projects
None yet
Development

No branches or pull requests

3 participants