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

[Bug][API] Team API is not working in k8s deployment #8271

Open
2 of 3 tasks
AnkeshThakur opened this issue Jan 17, 2025 · 1 comment
Open
2 of 3 tasks

[Bug][API] Team API is not working in k8s deployment #8271

AnkeshThakur opened this issue Jan 17, 2025 · 1 comment
Labels
severity/p0 This bug blocks key user journey and function severity/p1 This bug affects functionality or significantly affect ux type/bug This issue is a bug

Comments

@AnkeshThakur
Copy link

AnkeshThakur commented Jan 17, 2025

Search before asking

  • I had searched in the issues and found no similar issues.

What happened

Team and user API is not working and not able to fill the teams and user data. My deployment is done on kubernetes and all the values filled up as per the documentation. All other functionalities are working as expected but teams and users data api is not working and responding 500.

Here is the log from the container:

time="2025-01-17 09:34:28" level=info msg="redirect path: /rest/plugins/org/teams.csv to: /plugins/org/teams.csv"
2025/01/17 09:34:28 [Recovery] 2025/01/17 - 09:34:28 panic recovered:
PUT /rest/plugins/org/teams.csv HTTP/1.1
Host: devlake-app-lake.devlake.svc.cluster.local:8080
Accept: */*
Authorization: *
Content-Length: 680
Content-Type: multipart/form-data; boundary=------------------------nsDOmxfQmFYRaQW9NPt1y2
User-Agent: curl/8.7.1
X-Forwarded-For: 10.221.49.109
X-Forwarded-Host: devlake.development.********.com
X-Forwarded-Port: 80
X-Forwarded-Proto: http
X-Forwarded-Scheme: http
X-Real-Ip: 10.221.49.109
X-Request-Id: 7815a1e4196e533f483b93bed76ace61
X-Scheme: http
runtime error: invalid memory address or nil pointer dereference
/usr/local/go/src/runtime/panic.go:260 (0x9ae95c)
/usr/local/go/src/runtime/signal_unix.go:837 (0x9ae92c)
/app/plugins/org/api/team.go:88 (0x7f73a56c78c4)
/app/server/api/router.go:141 (0x161258e)
/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174 (0x16103a2)
/app/server/api/middlewares.go:95 (0x1610386)
/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174 (0x1610847)
/app/server/api/middlewares.go:117 (0x16106e2)
/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174 (0x1251da1)
/go/pkg/mod/github.com/gin-gonic/[email protected]/recovery.go:102 (0x1251d8c)
/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174 (0x1250ec6)
/go/pkg/mod/github.com/gin-gonic/[email protected]/logger.go:240 (0x1250ea9)
/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174 (0x124fd4a)
/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:620 (0x124f9d1)
/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:587 (0x124f6a4)
/app/server/api/middlewares.go:127 (0x16107fa)
/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174 (0x1251da1)
/go/pkg/mod/github.com/gin-gonic/[email protected]/recovery.go:102 (0x1251d8c)
/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174 (0x1250ec6)
/go/pkg/mod/github.com/gin-gonic/[email protected]/logger.go:240 (0x1250ea9)
/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174 (0x124fe2c)
/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:656 (0x124fe15)
/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:649 (0x124fb6c)
/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:576 (0x124f4fc)
/usr/local/go/src/net/http/server.go:2936 (0xce10b5)
/usr/local/go/src/net/http/server.go:1995 (0xcdc251)
/usr/local/go/src/runtime/asm_amd64.s:1598 (0x9cbac0)
[GIN] 2025/01/17 - 09:34:28 | 500 |    1.665045ms |   10.221.49.109 | PUT      "/plugins/org/teams.csv"
[GIN] 2025/01/17 - 09:34:28 | 500 |    4.180263ms |   10.221.49.109 | PUT      "/rest/plugins/org/teams.csv"

The CSV is in UTF-8 format and I followed steps provided here - https://devlake.apache.org/docs/Configuration/TeamConfiguration/.

When I try to deploy it locally using docker-compose with same images then it is updating the tables as expected. I am blocked as I need the data in k8s cluster where it is not working.

What do you expect to happen

Fill the teams and users table with CSV data.

How to reproduce

Deploy to k8s cluster using helm chart and try to fill up teams and users data using API.

Anything else

My suspicion is that PUT request is copying the CSV file to the container volume but as per chart volume option is removed. This is leading to invalid reference and causing this issue.

When I look at the revision history, I see there used to be a stateful set being deployed for lake but later it was removed here. My understanding is that container does not have any volume to write the CSV to.

Version

v1.0.2-beta4

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@AnkeshThakur AnkeshThakur added the type/bug This issue is a bug label Jan 17, 2025
Copy link

dosubot bot commented Jan 17, 2025

Hey there, @AnkeshThakur! I'm here to help you with any bugs, questions, or contributions you might have. Let's tackle this issue together!

The issue you're experiencing with the Team API in the Kubernetes deployment seems to be related to the removal of the stateful set from the Helm chart, which may have affected the volume configuration necessary for handling file uploads. In the current Helm chart, the default volume configurations are specified for MySQL and Lake, but it seems the necessary volume for the Team API to write the CSV file might not be properly configured.

To resolve this, you should ensure that your Kubernetes deployment has the appropriate volume configuration. You can modify the Helm chart to include a persistent volume for the Team API, allowing it to store the uploaded CSV files. This might involve adding a PersistentVolume and PersistentVolumeClaim to your Kubernetes setup, ensuring that the container has the necessary permissions and paths to write the files.

If the Helm chart previously included a stateful set that managed these volumes, you might need to manually configure these volumes now that the stateful set has been removed. This could involve specifying the volume mounts and claims directly in your deployment configuration.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@dosubot dosubot bot added severity/p0 This bug blocks key user journey and function severity/p1 This bug affects functionality or significantly affect ux labels Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/p0 This bug blocks key user journey and function severity/p1 This bug affects functionality or significantly affect ux type/bug This issue is a bug
Projects
None yet
Development

No branches or pull requests

1 participant