AnkeshThakur opened a new issue, #8271:
URL: https://github.com/apache/incubator-devlake/issues/8271

   ### Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/incubator-devlake/issues?q=is%3Aissue) 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.g2.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/gin@v1.9.1/context.go:174 (0x16103a2)
   /app/server/api/middlewares.go:95 (0x1610386)
   /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x1610847)
   /app/server/api/middlewares.go:117 (0x16106e2)
   /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x1251da1)
   /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/recovery.go:102 (0x1251d8c)
   /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x1250ec6)
   /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/logger.go:240 (0x1250ea9)
   /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x124fd4a)
   /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620 (0x124f9d1)
   /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:587 (0x124f6a4)
   /app/server/api/middlewares.go:127 (0x16107fa)
   /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x1251da1)
   /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/recovery.go:102 (0x1251d8c)
   /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x1250ec6)
   /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/logger.go:240 (0x1250ea9)
   /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x124fe2c)
   /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:656 (0x124fe15)
   /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:649 (0x124fb6c)
   /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/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](https://github.com/apache/incubator-devlake-helm-chart/commit/4a02a405d3e609d7278e9101ddc2ae40ae14d92c#diff-1ab41b2894aeda0490db6029c3104e0269ecf8f5c057e49b35fa2130a7547672R110)
 for lake but later it was removed 
[here](https://github.com/apache/incubator-devlake-helm-chart/pull/144/files#diff-1ab41b2894aeda0490db6029c3104e0269ecf8f5c057e49b35fa2130a7547672L131).
 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
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@devlake.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to