[Bug] Executing `kyuubi status` returns 'Kyuubi is not running' in docker container
- Dominant language
- Scala
- Stars
- 2.4k
- Forks
- 1k
- PR merge metrics
- No merged PRs in 30d
Description
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
### Search before asking
- [X] I have searched in the [issues](https://github.com/apache/kyuubi/issues?q=is%3Aissue) and found no similar issues.
### Describe the bug
I'm using the official docker image and helm chart to deploy and manage Kyuubi on Kubernetes.
I found that `bin/kyuubi status` returns `Kyuubi is not running` when the instance is actually up and running.
The PID value in the file should be `15`, however it is `1301` for the main instance in this case:
```bash
kyuubi@kyuubi-5b6784d6b4-gf2d4:/opt/kyuubi$ bin/kyuubi status
Warn: Not find kyuubi environment file /opt/kyuubi/conf/kyuubi-env.sh, using default ones...
Kyuubi is not running
kyuubi@kyuubi-5b6784d6b4-gf2d4:/opt/kyuubi$ ls -la pid
total 16
drwxrwxr-x 1 root root 4096 Mar 14 19:30 .
drwxrwxr-x 1 root root 4096 Mar 14 19:41 ..
-rw-r--r-- 1 kyuubi root 5 Mar 14 19:30 kyuubi--org.apache.kyuubi.server.KyuubiServer.pid
kyuubi@kyuubi-5b6784d6b4-gf2d4:/opt/kyuubi$ cat pid/kyuubi--org.apache.kyuubi.server.KyuubiServer.pid
1301
kyuubi@kyuubi-5b6784d6b4-gf2d4:/opt/kyuubi$ ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
kyuubi 1 0.0 0.0 7112 3388 ? Ss 19:23 0:00 bash ./bin/kyuubi run
kyuubi 15 1.0 17.2 3933096 1020332 ? Sl 19:23 0:26 /opt/java/openjdk/bin/java -cp /opt/kyuubi/jars/*:/opt/kyuubi/conf: org.apache.kyuubi.server.KyuubiServer
kyuubi 7952 0.0 0.0 7244 3956 pts/0 Ss 20:04 0:00 bash
kyuubi 8135 0.0 0.0 8896 3184 pts/0 R+ 20:05 0:00 ps aux
kyuubi@kyuubi-5b6784d6b4-gf2d4:/opt/kyuubi$ ps -p 15
PID TTY TIME CMD
15 ? 00:00:33 java
```
For the secondary instance there is no PID file at all:
```bash
kyuubi@kyuubi-5b6784d6b4-wpc54:/opt/kyuubi$ bin/kyuubi status
Warn: Not find kyuubi environment file /opt/kyuubi/conf/kyuubi-env.sh, using default ones...
Kyuubi is not running
kyuubi@kyuubi-5b6784d6b4-wpc54:/opt/kyuubi$ ls -la pid
total 12
drwxrwxr-x 1 root root 4096 Mar 8 11:21 .
drwxrwxr-x 1 root root 4096 Mar 14 19:23 .
```
---
`bin/kyuubi status` is needed for liveness and readiness probes, so I would highly appreciate alternative solution as well.
### Affects Version(s)
1.7.0
### Kyuubi Server Log Output
_No response_
### Kyuubi Engine Log Output
_No response_
### Kyuubi Server Configurations
_No response_
### Kyuubi Engine Configurations
_No response_
### Additional context
_No response_
### Are you willing to submit PR?
- [ ] Yes. I would be willing to submit a PR with guidance from the Kyuubi community to fix.
- [ ] No. I cannot submit a PR at this time.
Contributor guide
Research direction
Start with bin/kyuubi and reproduce the status command in the official Docker image or Helm deployment. Compare the PID file and actual Java process for the primary instance, and check the behavior when no PID file exists for a secondary instance. Done means status accurately detects running Kyuubi instances for liveness and readiness probes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, helm, kubernetes, shell
- Domain
- cli, devops, infrastructure
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100