[Bug]: skipping enabling swagger
userbradley opened this issue · comments
zot version
zot-linux-amd64:v2.0.0-rc6
Describe the bug
When using any config file, I get the error, and the UI does not load.
I have tried with every config file in the examples
dir in this repo
{"level":"warn","goroutine":1,"caller":"zotregistry.io/zot/pkg/debug/swagger/swagger_disabled.go:22","time":"2023-10-29T00:58:54.56137134Z","message":"skipping enabling swagger because given zot binary doesn't include this feature, please build a binary that does so"}
To reproduce
Kubernets Manifest
apiVersion: v1
kind: ConfigMap
metadata:
name: zot-config
data:
config.json: "{\n \"storage\": { \"rootDirectory\": \"/var/lib/registry\" },\n \"http\": { \"address\": \"0.0.0.0\", \"port\": \"5000\" },\n \"log\": { \"level\": \"debug\" }\n}"
---
# Source: zot/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: zot
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: zot
app.kubernetes.io/instance: zot
template:
metadata:
labels:
app.kubernetes.io/name: zot
app.kubernetes.io/instance: zot
spec:
containers:
- name: zot
image: "ghcr.io/project-zot/zot-linux-amd64:v2.0.0-rc6"
imagePullPolicy: IfNotPresent
ports:
- name: zot
containerPort: 5000
protocol: TCP
volumeMounts:
- mountPath: '/etc/zot'
name: zot-config
volumes:
- name: zot-config
configMap:
name: zot-config
Expected behavior
App will run completely, and the UI loads
Screenshots
There are then no Logs on the container about HTTP get requests
Additional context
➜ kubectl logs -f zot-55945f4c65-bgjml
{"level":"info","params":{"distSpecVersion":"1.1.0-dev","GoVersion":"go1.20.6","Commit":"v2.0.0-rc6-de24bd937f20a66628fdacf4d658eb95df0b3769","ReleaseTag":"v2.0.0-rc6","BinaryType":"-apikey-lint-metrics-mgmt-scrub-search-sync-ui-userprefs","Storage":{"RootDirectory":"/var/lib/registry","Dedupe":true,"RemoteCache":false,"GC":true,"Commit":false,"GCDelay":3600000000000,"GCInterval":0,"StorageDriver":null,"CacheDriver":null,"SubPaths":null},"HTTP":{"Address":"0.0.0.0","Port":"5000","AllowOrigin":"","TLS":null,"Auth":{"FailDelay":0,"HTPasswd":{"Path":""},"LDAP":null,"Bearer":null,"OpenID":null},"AccessControl":null,"Realm":"","Ratelimit":null},"Log":{"Level":"debug","Output":"","Audit":""},"Extensions":null,"scheduler":null},"goroutine":1,"caller":"zotregistry.io/zot/pkg/api/controller.go:213","time":"2023-10-29T00:58:54.426090272Z","message":"configuration settings"}
{"level":"info","cpus":4,"max. open files":1048576,"listen backlog":"4096","max. inotify watches":"60272","goroutine":1,"caller":"zotregistry.io/zot/pkg/api/controller.go:89","time":"2023-10-29T00:58:54.426209007Z","message":"runtime params"}
{"level":"info","goroutine":16,"caller":"zotregistry.io/zot/pkg/storage/common/common.go:838","time":"2023-10-29T00:58:54.558165564Z","caller":"zotregistry.io/zot/pkg/storage/common/common.go:838","message":"dedupe rebuild: finished"}
{"level":"warn","goroutine":1,"caller":"zotregistry.io/zot/pkg/debug/swagger/swagger_disabled.go:22","time":"2023-10-29T00:58:54.56137134Z","message":"skipping enabling swagger because given zot binary doesn't include this feature, please build a binary that does so"}
@userbradley have you tried this example config?
https://github.com/project-zot/zot/blob/main/examples/config-ui.json
Hey, thanks for getting back to me!
Yeah, I get a new error, not sure what's going on haha
➜ kubectl logs -f zot-55945f4c65-nfgxg
{"level":"info","trivyDownloadURL":"ghcr.io/aquasecurity/trivy-db","time":"2023-10-29T12:42:16Z","message":"Config: using default Trivy DB download URL."}
{"level":"info","trivyJavaDownloadURL":"ghcr.io/aquasecurity/trivy-java-db","time":"2023-10-29T12:42:16Z","message":"Config: using default Trivy Java DB download URL."}
{"level":"warn","error":"config: invalid config","time":"2023-10-29T12:42:16Z","message":"UI functionality can't be used without mgmt extension."}
panic: config: invalid config
goroutine 1 [running]:
zotregistry.io/zot/pkg/cli.newServeCmd.func1(0xc00100a900?, {0xc0002c18c0, 0x1, 0x1?})
zotregistry.io/zot/pkg/cli/root.go:49 +0x145
github.com/spf13/cobra.(*Command).execute(0xc00100a900, {0xc0002c1880, 0x1, 0x1})
github.com/spf13/cobra@v1.7.0/command.go:944 +0x847
github.com/spf13/cobra.(*Command).ExecuteC(0xc00100a600)
github.com/spf13/cobra@v1.7.0/command.go:1068 +0x3bd
github.com/spf13/cobra.(*Command).Execute(0xc0000061a0?)
github.com/spf13/cobra@v1.7.0/command.go:992 +0x19
main.main()
zotregistry.io/zot/cmd/zot/main.go:10 +0x1e
And then the config
apiVersion: v1
kind: ConfigMap
metadata:
name: zot-config
data:
config.json: |
{
"distSpecVersion": "1.1.0-dev",
"storage": {
"rootDirectory": "/tmp/zot"
},
"http": {
"address": "0.0.0.0",
"port": "8080"
},
"log": {
"level": "debug"
},
"extensions": {
"search": {
"cve": {
"updateInterval": "2h"
}
},
"ui": {
"enable": true
}
}
}
---
# Source: zot/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: zot
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: zot
app.kubernetes.io/instance: zot
template:
metadata:
labels:
app.kubernetes.io/name: zot
app.kubernetes.io/instance: zot
spec:
containers:
- name: zot
image: "ghcr.io/project-zot/zot-linux-amd64:v2.0.0-rc6"
imagePullPolicy: IfNotPresent
ports:
- name: zot
containerPort: 5000
protocol: TCP
volumeMounts:
- mountPath: '/etc/zot'
name: zot-config
volumes:
- name: zot-config
configMap:
name: zot-config
The container will then spin with error
@userbradley ah! you are using 2.0.0-rc6
Since these are rc releases, some things are changing along the way.
https://github.com/project-zot/zot/tree/v2.0.0-rc6/examples
https://github.com/project-zot/zot/blob/v2.0.0-rc6/examples/config-ui.json
^ pls try this instead
@rchincha that seems to have worked! Thanks!
I'd prefer to use a yaml file for config, will that work natively with this release or do I need to use a specific container image? Noticed some images are build with run config.json
and some run config.yaml
One other thing, OpenID seems to not be documented at all. Is this a feature that is going to be released properly soon? I've had a look at the code and it seems to only really work when the callback is to http://0.0.0.0:port
- Some guidance here would be cool! Happy to contribute back documentation :)
One other thing, OpenID seems to not be documented at all
https://github.com/project-zot/project-zot.github.io/blob/main/docs/articles/authn-authz.md
We are updating our docs here. The full documentation will be published when we cut an official release.
@userbradley closing this issue. Pls re-open if needed.
PRs always welcome and appreciated. If you intend to contribute, pls do so at:
https://github.com/project-zot/project-zot.github.io
@rchincha Thanks for all your help!
Once the release is cut I'll certainly be opening PR's!