You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gravitino.apache.org by "roryqi (via GitHub)" <gi...@apache.org> on 2026/06/15 17:32:48 UTC
[PR] [#11652] fix(docker): chmod 775 server home dir for non-root log creation [gravitino]
roryqi opened a new pull request, #11659:
URL: https://github.com/apache/gravitino/pull/11659
### What changes were proposed in this pull request?
Add `chmod 775 <server-home>` to the RUN step of the gravitino,
iceberg-rest-server and lance-rest-server Dockerfiles so the directory
created by `WORKDIR` becomes group-writable.
### Why are the changes needed?
PR #11533 replaced `chmod -R g+rwX <dir>` with `COPY --chmod=775`. However
`COPY --chmod` only applies to the copied contents, not to the target
directory itself, which was created earlier by `WORKDIR` and retains the
default `755 root:root` permission. The container runs as `uid=1000, gid=0`,
so the non-root user cannot create subdirectories such as
`/opt/gravitino/logs`, and the server fails at startup:
```
main ERROR Unable to create file /opt/gravitino/logs/gravitino-server.log
java.io.IOException: Could not create directory /opt/gravitino/logs
```
A single non-recursive `chmod 775` on the top directory fixes this while
preserving #11533's goal of not duplicating an image layer from a recursive
chmod.
Fix: #11652
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Built the real gravitino image via `dev/docker/build-docker.sh` and ran it
as `uid=1000, gid=0`:
- `/opt/gravitino` now has `drwxrwxr-x` (775) instead of `755`.
- The server starts, creates `/opt/gravitino/logs/gravitino-server.log`,
and `GET /api/version` returns HTTP 200.
- Confirmed the previous `Could not create directory` error no longer appears.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#11652] fix(docker): chmod 775 server home dir for non-root log creation [gravitino]
Posted by "danhuawang (via GitHub)" <gi...@apache.org>.
danhuawang commented on PR #11659:
URL: https://github.com/apache/gravitino/pull/11659#issuecomment-4715675381
LGTM
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#11652] fix(docker): chmod 775 server home dir for non-root log creation [gravitino]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #11659:
URL: https://github.com/apache/gravitino/pull/11659#discussion_r3417709281
##########
dev/docker/lance-rest-server/Dockerfile:
##########
@@ -27,7 +27,8 @@ WORKDIR /opt/gravitino-lance-rest-server
COPY --chmod=775 packages/gravitino-lance-rest-server /opt/gravitino-lance-rest-server
-RUN chmod +x /opt/gravitino-lance-rest-server/bin/start-lance-rest-server.sh
+RUN chmod 775 /opt/gravitino-lance-rest-server \
+ && chmod +x /opt/gravitino-lance-rest-server/bin/start-lance-rest-server.sh
Review Comment:
In this image there is no user/group created for uid 1000 (unlike the other two Dockerfiles). If the container runs as uid=1000 with a non-root primary gid (common when using numeric USER), then `chmod 775` on a `root:root` directory still won’t allow writes, so the log-directory issue can persist. Add the same `useradd -u 1000 -g 0 ...` step (or explicitly set `USER 1000:0`) to guarantee the intended gid=0/group-writable behavior.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#11652] fix(docker): chmod 775 server home dir for non-root log creation [gravitino]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #11659:
URL: https://github.com/apache/gravitino/pull/11659#issuecomment-4711285829
<!-- coverage-report -->
### Code Coverage Report
|Overall Project|67.02%|:green_circle:|
|:-|:-|:-:|
|Files changed|No Java source files changed|-|
<br>
|Module|Coverage||
|:-|:-|:-:|
|aliyun|1.72%|:red_circle:|
|api|46.82%|:green_circle:|
|authorization-common|85.96%|:green_circle:|
|aws|3.66%|:red_circle:|
|azure|2.47%|:red_circle:|
|catalog-common|10.4%|:red_circle:|
|catalog-fileset|80.23%|:green_circle:|
|catalog-glue|66.91%|:green_circle:|
|catalog-hive|79.44%|:green_circle:|
|catalog-jdbc-clickhouse|80.02%|:green_circle:|
|catalog-jdbc-common|44.22%|:green_circle:|
|catalog-jdbc-doris|80.28%|:green_circle:|
|catalog-jdbc-hologres|54.03%|:green_circle:|
|catalog-jdbc-mysql|79.23%|:green_circle:|
|catalog-jdbc-oceanbase|78.38%|:green_circle:|
|catalog-jdbc-postgresql|82.29%|:green_circle:|
|catalog-jdbc-starrocks|78.51%|:green_circle:|
|catalog-kafka|77.01%|:green_circle:|
|catalog-lakehouse-generic|58.53%|:green_circle:|
|catalog-lakehouse-hudi|79.1%|:green_circle:|
|catalog-lakehouse-iceberg|85.86%|:green_circle:|
|catalog-lakehouse-paimon|80.02%|:green_circle:|
|catalog-model|77.72%|:green_circle:|
|cli|44.51%|:green_circle:|
|client-java|78.01%|:green_circle:|
|common|50.17%|:green_circle:|
|core|82.38%|:green_circle:|
|filesystem-hadoop3|77.27%|:green_circle:|
|flink|0.0%|:red_circle:|
|flink-common|46.25%|:green_circle:|
|flink-runtime|0.0%|:red_circle:|
|gcp|14.12%|:red_circle:|
|hadoop-common|10.88%|:red_circle:|
|hive-metastore-common|53.77%|:green_circle:|
|iceberg-common|58.15%|:green_circle:|
|iceberg-rest-server|73.92%|:green_circle:|
|idp-basic|86.18%|:green_circle:|
|integration-test-common|0.0%|:red_circle:|
|jobs|66.17%|:green_circle:|
|lance-common|20.83%|:red_circle:|
|lance-rest-server|60.54%|:green_circle:|
|lineage|53.02%|:green_circle:|
|optimizer|82.95%|:green_circle:|
|optimizer-api|21.95%|:red_circle:|
|server|85.87%|:green_circle:|
|server-common|73.79%|:green_circle:|
|spark|28.57%|:red_circle:|
|spark-common|41.66%|:green_circle:|
|trino-connector|40.13%|:green_circle:|
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#11652] fix(docker): chmod 775 server home dir for non-root log creation [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on PR #11659:
URL: https://github.com/apache/gravitino/pull/11659#issuecomment-4714649606
@danhuawang Did you test to make sure it works?
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#11652] fix(docker): chmod 775 server home dir for non-root log creation [gravitino]
Posted by "roryqi (via GitHub)" <gi...@apache.org>.
roryqi commented on code in PR #11659:
URL: https://github.com/apache/gravitino/pull/11659#discussion_r3417754884
##########
dev/docker/lance-rest-server/Dockerfile:
##########
@@ -27,7 +27,8 @@ WORKDIR /opt/gravitino-lance-rest-server
COPY --chmod=775 packages/gravitino-lance-rest-server /opt/gravitino-lance-rest-server
-RUN chmod +x /opt/gravitino-lance-rest-server/bin/start-lance-rest-server.sh
+RUN chmod 775 /opt/gravitino-lance-rest-server \
+ && chmod +x /opt/gravitino-lance-rest-server/bin/start-lance-rest-server.sh
Review Comment:
Thanks for the review. I tested this scenario and the issue doesn't actually reproduce on this image. A bare numeric `USER 1000` with no matching `/etc/passwd` entry defaults the primary gid to 0 (per OCI runtime behavior), so the directory is already group-writable.
Built the equivalent image (`USER 1000`, no `useradd`) and ran it:
```
$ id
uid=1000 gid=0(root) groups=0(root)
$ ls -ld /opt/test
drwxrwxr-x 1 root root /opt/test
$ mkdir /opt/test/logs && echo OK
OK
```
The gid is already 0, so the `chmod 775` makes the log directory writable. `useradd -u 1000 -g 0` would not change this behavior — it only adds a passwd entry for username resolution, and it does not guard against a runtime `--user 1000:1000` override either. So I will keep the lance Dockerfile as-is.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#11652] fix(docker): chmod 775 server home dir for non-root log creation [gravitino]
Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 merged PR #11659:
URL: https://github.com/apache/gravitino/pull/11659
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#11652] fix(docker): chmod 775 server home dir for non-root log creation [gravitino]
Posted by "danhuawang (via GitHub)" <gi...@apache.org>.
danhuawang commented on PR #11659:
URL: https://github.com/apache/gravitino/pull/11659#issuecomment-4715674354
> @danhuawang Did you test to make sure it works?
I test, it works.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org