newly released helm-charts does not allow to create repository via API #171

Closed
opened 2021-06-08 21:39:50 +00:00 by Rafal · 6 comments

Version of helm charts

gitea-charts/gitea	3.1.2        	1.14.1     	Gitea Helm chart for Kubernetes

does not allow to create a git repository using the Gitea REST API.

Deployed using helm values:

gitea:
  admin:
    username: "{{ gitops_user }}"
    password: "{{ gitops_password }}"
    email: "admin@seldon.io"
service:
  http:
    type: LoadBalancer

After port-forwarding

kubectl --namespace gitea-system port-forward svc/gitea-http 3000:3000

this does not work.

curl -v -s -XPOST -H "Content-Type: application/json" -k -d '{"auto_init": true, "name": "test-repo"}' -u seldon:12341234 http://localhost:3000/api/v1/user/repos

It did work fine few days ago when latest helm chart out there was

gitea-charts/gitea	3.0.0        	1.14.1     	Gitea Helm chart for Kubernetes

or after specifying --version 3.0.0 now.

Also I noticed that Gitea image used in chart 3.1.2 is actually 1.14.2 and not 1.14.1 like helm search ... command would indicate.

Version of helm charts ``` gitea-charts/gitea 3.1.2 1.14.1 Gitea Helm chart for Kubernetes ``` does not allow to create a git repository using the Gitea REST API. Deployed using helm values: ```yaml gitea: admin: username: "{{ gitops_user }}" password: "{{ gitops_password }}" email: "admin@seldon.io" service: http: type: LoadBalancer ``` After port-forwarding ``` kubectl --namespace gitea-system port-forward svc/gitea-http 3000:3000 ``` this does not work. ``` curl -v -s -XPOST -H "Content-Type: application/json" -k -d '{"auto_init": true, "name": "test-repo"}' -u seldon:12341234 http://localhost:3000/api/v1/user/repos ``` It did work fine few days ago when latest helm chart out there was ``` gitea-charts/gitea 3.0.0 1.14.1 Gitea Helm chart for Kubernetes ``` or after specifying `--version 3.0.0` now. Also I noticed that Gitea image used in chart `3.1.2` is actually `1.14.2` and not `1.14.1` like `helm search ...` command would indicate.
Author

Sorry, forgot to include the response

{"message":"initRepository: Failed to create temp dir for repository /data/git/gitea-repositories/seldon/test-repo.git: mkdir /tmp/gitea/gitea-test-repo639015540: permission denied","url":"http://git.example.com/api/swagger"}

and more details output from curl's -v

*   Trying ::1:3000...
* TCP_NODELAY set
* Connected to localhost (::1) port 3000 (#0)
* Server auth using Basic with user 'seldon'
> POST /api/v1/user/repos HTTP/1.1
> Host: localhost:3000
> Authorization: Basic c2VsZG9uOjEyMzQxMjM0
> User-Agent: curl/7.68.0
> Accept: */*
> Content-Type: application/json
> Content-Length: 40
> 
} [40 bytes data]
* upload completely sent off: 40 out of 40 bytes
* Mark bundle as not supporting multiuse
< HTTP/1.1 500 Internal Server Error
< Content-Type: application/json;charset=utf-8
< Set-Cookie: i_like_gitea=5d00b3fa4bb98581; Path=/; HttpOnly
< Set-Cookie: _csrf=Qi547VByupXBAyvQEZkqKB890YE6MTYyMzE4NTk1OTgxOTQ3MzM3Ng; Path=/; Expires=Wed, 09 Jun 2021 20:59:19 GMT; HttpOnly; SameSite=Lax
< X-Content-Type-Options: nosniff
< X-Frame-Options: SAMEORIGIN
< Date: Tue, 08 Jun 2021 20:59:19 GMT
< Content-Length: 226
< 
{ [226 bytes data]
* Connection #0 to host localhost left intact
Sorry, forgot to include the response ``` {"message":"initRepository: Failed to create temp dir for repository /data/git/gitea-repositories/seldon/test-repo.git: mkdir /tmp/gitea/gitea-test-repo639015540: permission denied","url":"http://git.example.com/api/swagger"} ``` and more details output from curl's -v ``` * Trying ::1:3000... * TCP_NODELAY set * Connected to localhost (::1) port 3000 (#0) * Server auth using Basic with user 'seldon' > POST /api/v1/user/repos HTTP/1.1 > Host: localhost:3000 > Authorization: Basic c2VsZG9uOjEyMzQxMjM0 > User-Agent: curl/7.68.0 > Accept: */* > Content-Type: application/json > Content-Length: 40 > } [40 bytes data] * upload completely sent off: 40 out of 40 bytes * Mark bundle as not supporting multiuse < HTTP/1.1 500 Internal Server Error < Content-Type: application/json;charset=utf-8 < Set-Cookie: i_like_gitea=5d00b3fa4bb98581; Path=/; HttpOnly < Set-Cookie: _csrf=Qi547VByupXBAyvQEZkqKB890YE6MTYyMzE4NTk1OTgxOTQ3MzM3Ng; Path=/; Expires=Wed, 09 Jun 2021 20:59:19 GMT; HttpOnly; SameSite=Lax < X-Content-Type-Options: nosniff < X-Frame-Options: SAMEORIGIN < Date: Tue, 08 Jun 2021 20:59:19 GMT < Content-Length: 226 < { [226 bytes data] * Connection #0 to host localhost left intact ```
Member

Hi. I assume the default root-based image is in use? Not the rootless one?
It is probably linked to #160 as it changed the tmp path for e.g. repo creation and the used image version as well. ? Does it work if you explicitly specify 1.14.1 as image version or is it still an issue then? Would be helpful to identify the root cause.

Edit: Hrm. Tested it and can reproduce it. Happens when using root-based image and it's not only the API. It's not possible to create repos at all. ? Fixing the rootless image broke the root-based image.

Hi. I assume the default root-based image is in use? Not the rootless one? It is probably linked to #160 as it changed the tmp path for e.g. repo creation and the used image version as well. ? Does it work if you explicitly specify 1.14.1 as image version or is it still an issue then? Would be helpful to identify the root cause. Edit: Hrm. Tested it and can reproduce it. Happens when using root-based image and it's not only the API. It's not possible to create repos at all. ? Fixing the rootless image broke the root-based image.
Member

@Rafal I provided a PR to fix this. Happy for your feedback. ?

@Rafal I provided a PR to fix this. Happy for your feedback. ?
Author

Happens when using root-based image and it's not only the API. It's not possible to create repos at all.

That's odd, I was able to create repos via the UI...

@Rafal I provided a PR to fix this. Happy for your feedback. ?

Cool, I will try to test it at some point today!

> Happens when using root-based image and it's not only the API. It's not possible to create repos at all. That's odd, I was able to create repos via the UI... > @Rafal I provided a PR to fix this. Happy for your feedback. ? Cool, I will try to test it at some point today!
Author

Just tested the newly published helm chart

gitea-charts/gitea	3.1.3        	1.14.2     	Gitea Helm chart for Kubernetes

and all seems to work fine!

Just tested the newly published helm chart ``` gitea-charts/gitea 3.1.3 1.14.2 Gitea Helm chart for Kubernetes ``` and all seems to work fine!
Member

Awesome to hear that.

Awesome to hear that.
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: gitea/helm-chart#171
No description provided.