You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/10/29 04:01:27 UTC

[GitHub] [apisix-java-plugin-runner] BlackEragon opened a new issue #78: bug: socket type file permissions not set accurately after apisix-java-plugin-runner automatically create this file when it starts

BlackEragon opened a new issue #78:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/78


   ### Issue description
   socket type file permissions not set accurately after apisix-java-plugin-runner automatically create this file when it starts,Why not set the file permissions after automatically create in the code?
   like:
   ···
           logger.warn("java runner is listening on the socket file: {}", socketFile);
           Runtime.getRuntime().exec("chmod 766 " + socketFile);
   ···
   
   ### Environment
   
   * your apisix-java-plugin-runner version
   
   ### What's the actual result? (including assertion message & call stack if applicable)
   
   phase_func(): failed to connect to the unix socket unix:/tmp/runner.sock: permission denied
   
   ### What's the expected result?
   
   This will not need to manually execute the command in docker.
   


-- 
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: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] BlackEragon commented on issue #78: bug: socket type file permissions not set accurately after apisix-java-plugin-runner automatically create this file when it starts

Posted by GitBox <gi...@apache.org>.
BlackEragon commented on issue #78:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/78#issuecomment-954461468


    /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
   ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
    \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
     '  |____| .__|_| |_|_| |_\__, | / / / /
    =========|_|==============|___/=/_/_/_/
   , context: ngx.timer
   2021/10/29 06:17:28 [warn] 55#55: *178 [lua] init.lua:681:  :: Spring Boot ::                (v2.4.5), context: ngx.timer
   2021/10/29 06:17:28 [warn] 55#55: *178 [lua] init.lua:681: 
   
   , context: ngx.timer
   2021/10/29 06:17:35 [warn] 55#55: *178 [lua] init.lua:681: 2021-10-29 06:17:35.284  WARN 65 --- [           main] o.a.a.p.runner.server.ApplicationRunner  : java runner is listening on the socket file: /usr/local/apisix/conf/apisix.sock
   , context: ngx.timer
   2021/10/29 06:19:12 [crit] 48#48: *12856 connect() to unix:/usr/local/apisix/conf/apisix.sock failed (13: Permission denied), client: 172.30.0.1, server: _, request: "GET /dcp-sys/private/api/v1/clusters HTTP/1.1", host: "localhost:9080"
   2021/10/29 06:19:12 [error] 48#48: *12856 [lua] init.lua:617: phase_func(): failed to connect to the unix socket unix:/usr/local/apisix/conf/apisix.sock: permission denied, client: 172.30.0.1, server: _, request: "GET /dcp-sys/private/api/v1/clusters/kem-config HTTP/1.1", host: "localhost:9080"
   2021/10/29 06:19:12 [warn] 48#48: *12856 [lua] plugin.lua:680: run_plugin(): ext-plugin-pre-req exits with http status code 503, client: 172.30.0.1, server: _, request: "GET /dcp-sys/private/api/v1/clusters HTTP/1.1", host: "localhost:9080"


-- 
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: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] geekgao commented on issue #78: bug: socket type file permissions not set accurately after apisix-java-plugin-runner automatically create this file when it starts

Posted by GitBox <gi...@apache.org>.
geekgao commented on issue #78:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/78#issuecomment-989653050


   这个问题我们也遇到了,排查半天,感觉太诡异了,应该设置为noboy才合理吧 ;(


-- 
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: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] cws1981 edited a comment on issue #78: bug: socket type file permissions not set accurately after apisix-java-plugin-runner automatically create this file when it starts

Posted by GitBox <gi...@apache.org>.
cws1981 edited a comment on issue #78:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/78#issuecomment-981078931


   this is my Dockerfile:
   ```
   FROM apache/apisix:2.10.0-alpine
   
   RUN sed -i "s/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g" /etc/apk/repositories && apk add --no-cache openjdk11-jre-headless
   
   ADD apisix-java-plugin-runner.jar /usr/local/apisix-java-plugin-runner.jar
   ```
   i rebuild docker images add apisix-java-plugin-runner.jar, so the java-plugin will in the same container with apisix, but it still outputs errors in the error.log:
   ```
   2021/11/25 06:33:31 [crit] 44#44: *2280 connect() to unix:/usr/local/apisix/conf/apisix-1.sock failed (13: Permission denied)
   ```
   
   this is the processes in the container:
   ```
   PID   USER     TIME  COMMAND
       1 root      0:00 {openresty} nginx: master process /usr/local/openresty/bin/openresty -p /usr/local/apisix -g daemon off;
      44 nobody    0:00 {openresty} nginx: worker process
      45 nobody    0:00 {openresty} nginx: worker process
      46 nobody    0:00 {openresty} nginx: worker process
      47 nobody    0:00 {openresty} nginx: worker process
      48 nobody    0:00 {openresty} nginx: cache manager process
      49 nobody    0:00 {openresty} nginx: cache loader process
      50 root      0:00 {openresty} nginx: privileged agent process
      56 root      0:15 java -jar -Xmx4g -Xms4g /usr/local/apisix-runner-bin/apisix-java-plugin-runner.jar
   ```


-- 
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: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] tzssangglass commented on issue #78: bug: socket type file permissions not set accurately after apisix-java-plugin-runner automatically create this file when it starts

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #78:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/78#issuecomment-954616399


   I think it has to do with permissions in a docker environment, not with the project.
   
   maybe releated: https://github.com/apache/apisix-java-plugin-runner/issues/61


-- 
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: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] tzssangglass commented on issue #78: bug: socket type file permissions not set accurately after apisix-java-plugin-runner automatically create this file when it starts

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #78:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/78#issuecomment-1022785798


   considered as resolved, feel free to reopen this.
   
   ref to: https://github.com/apache/apisix-java-plugin-runner/blob/cbd3b3a6ad536df5d1ea71336c4a319a28c0622d/runner-core/src/main/java/org/apache/apisix/plugin/runner/server/ApplicationRunner.java#L109


-- 
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: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] cws1981 commented on issue #78: bug: socket type file permissions not set accurately after apisix-java-plugin-runner automatically create this file when it starts

Posted by GitBox <gi...@apache.org>.
cws1981 commented on issue #78:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/78#issuecomment-981080801


   > 1. on debug mode, the socket file is generated by Java plugin runner;
   > 2. on run mode, the socket file is generated by APISXI, so we don't need to set the file permissions by code, otherwise this code will cause an exception in run mode.
   
   apisix worker process user is nobody no Permission


-- 
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: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] tzssangglass closed issue #78: bug: socket type file permissions not set accurately after apisix-java-plugin-runner automatically create this file when it starts

Posted by GitBox <gi...@apache.org>.
tzssangglass closed issue #78:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/78


   


-- 
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: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] cws1981 edited a comment on issue #78: bug: socket type file permissions not set accurately after apisix-java-plugin-runner automatically create this file when it starts

Posted by GitBox <gi...@apache.org>.
cws1981 edited a comment on issue #78:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/78#issuecomment-981078931


   This is my Dockerfile:
   ```
   FROM apache/apisix:2.10.0-alpine
   
   RUN sed -i "s/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g" /etc/apk/repositories && apk add --no-cache openjdk11-jre-headless
   
   ADD apisix-java-plugin-runner.jar /usr/local/apisix-java-plugin-runner.jar
   ```
   I rebuild docker images add apisix-java-plugin-runner.jar, so the java-plugin will in the same container with apisix, but it still outputs errors in the error.log:
   ```
   2021/11/25 06:33:31 [crit] 44#44: *2280 connect() to unix:/usr/local/apisix/conf/apisix-1.sock failed (13: Permission denied)
   ```
   
   this is the processes in the container:
   ```
   PID   USER     TIME  COMMAND
       1 root      0:00 {openresty} nginx: master process /usr/local/openresty/bin/openresty -p /usr/local/apisix -g daemon off;
      44 nobody    0:00 {openresty} nginx: worker process
      45 nobody    0:00 {openresty} nginx: worker process
      46 nobody    0:00 {openresty} nginx: worker process
      47 nobody    0:00 {openresty} nginx: worker process
      48 nobody    0:00 {openresty} nginx: cache manager process
      49 nobody    0:00 {openresty} nginx: cache loader process
      50 root      0:00 {openresty} nginx: privileged agent process
      56 root      0:15 java -jar -Xmx4g -Xms4g /usr/local/apisix-runner-bin/apisix-java-plugin-runner.jar
   ```
   pid 44 user is nobody so not Permission


-- 
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: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] cws1981 edited a comment on issue #78: bug: socket type file permissions not set accurately after apisix-java-plugin-runner automatically create this file when it starts

Posted by GitBox <gi...@apache.org>.
cws1981 edited a comment on issue #78:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/78#issuecomment-981078931


   This is my Dockerfile:
   ```
   FROM apache/apisix:2.10.0-alpine
   
   RUN sed -i "s/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g" /etc/apk/repositories && apk add --no-cache openjdk11-jre-headless
   
   ADD apisix-java-plugin-runner.jar /usr/local/apisix-java-plugin-runner.jar
   ```
   I rebuild docker images add apisix-java-plugin-runner.jar, so the java-plugin will in the same container with apisix, but it still outputs errors in the error.log:
   ```
   2021/11/25 06:33:31 [crit] 44#44: *2280 connect() to unix:/usr/local/apisix/conf/apisix-1.sock failed (13: Permission denied)
   ```
   
   this is the processes in the container:
   ```
   PID   USER     TIME  COMMAND
       1 root      0:00 {openresty} nginx: master process /usr/local/openresty/bin/openresty -p /usr/local/apisix -g daemon off;
      44 nobody    0:00 {openresty} nginx: worker process
      45 nobody    0:00 {openresty} nginx: worker process
      46 nobody    0:00 {openresty} nginx: worker process
      47 nobody    0:00 {openresty} nginx: worker process
      48 nobody    0:00 {openresty} nginx: cache manager process
      49 nobody    0:00 {openresty} nginx: cache loader process
      50 root      0:00 {openresty} nginx: privileged agent process
      56 root      0:15 java -jar -Xmx4g -Xms4g /usr/local/apisix-runner-bin/apisix-java-plugin-runner.jar
   ```
   pid 44 user is nobody so no Permission


-- 
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: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] geekgao edited a comment on issue #78: bug: socket type file permissions not set accurately after apisix-java-plugin-runner automatically create this file when it starts

Posted by GitBox <gi...@apache.org>.
geekgao edited a comment on issue #78:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/78#issuecomment-989653050


   这个问题我们也遇到了,排查半天,感觉太诡异了,socket权限应该设置为noboy才合理吧 ;(


-- 
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: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] cws1981 commented on issue #78: bug: socket type file permissions not set accurately after apisix-java-plugin-runner automatically create this file when it starts

Posted by GitBox <gi...@apache.org>.
cws1981 commented on issue #78:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/78#issuecomment-981078931


   this is my Dockerfile:
   ```
   FROM apache/apisix:2.10.0-alpine
   
   RUN sed -i "s/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g" /etc/apk/repositories && apk add --no-cache openjdk11-jre-headless
   
   ADD apisix-java-plugin-runner.jar /usr/local/apisix-java-plugin-runner.jar
   ```
   i rebuild docker images add apisix-java-plugin-runner.jar, so the java-plugin will in the same container with apisix, but when it still outputs errors in the error.log:
   ```
   2021/11/25 06:33:31 [crit] 44#44: *2280 connect() to unix:/usr/local/apisix/conf/apisix-1.sock failed (13: Permission denied)
   ```
   
   this is the processes in the container:
   ```
   PID   USER     TIME  COMMAND
       1 root      0:00 {openresty} nginx: master process /usr/local/openresty/bin/openresty -p /usr/local/apisix -g daemon off;
      44 nobody    0:00 {openresty} nginx: worker process
      45 nobody    0:00 {openresty} nginx: worker process
      46 nobody    0:00 {openresty} nginx: worker process
      47 nobody    0:00 {openresty} nginx: worker process
      48 nobody    0:00 {openresty} nginx: cache manager process
      49 nobody    0:00 {openresty} nginx: cache loader process
      50 root      0:00 {openresty} nginx: privileged agent process
      56 root      0:15 java -jar -Xmx4g -Xms4g /usr/local/apisix-runner-bin/apisix-java-plugin-runner.jar
   ```


-- 
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: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] cws1981 edited a comment on issue #78: bug: socket type file permissions not set accurately after apisix-java-plugin-runner automatically create this file when it starts

Posted by GitBox <gi...@apache.org>.
cws1981 edited a comment on issue #78:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/78#issuecomment-981078931


   This is my Dockerfile:
   ```
   FROM apache/apisix:2.10.0-alpine
   
   RUN sed -i "s/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g" /etc/apk/repositories && apk add --no-cache openjdk11-jre-headless
   
   ADD apisix-java-plugin-runner.jar /usr/local/apisix-java-plugin-runner.jar
   ```
   I rebuild docker images add apisix-java-plugin-runner.jar, so the java-plugin will in the same container with apisix, but it still outputs errors in the error.log:
   ```
   2021/11/25 06:33:31 [crit] 44#44: *2280 connect() to unix:/usr/local/apisix/conf/apisix-1.sock failed (13: Permission denied)
   ```
   
   this is the processes in the container:
   ```
   PID   USER     TIME  COMMAND
       1 root      0:00 {openresty} nginx: master process /usr/local/openresty/bin/openresty -p /usr/local/apisix -g daemon off;
      44 nobody    0:00 {openresty} nginx: worker process
      45 nobody    0:00 {openresty} nginx: worker process
      46 nobody    0:00 {openresty} nginx: worker process
      47 nobody    0:00 {openresty} nginx: worker process
      48 nobody    0:00 {openresty} nginx: cache manager process
      49 nobody    0:00 {openresty} nginx: cache loader process
      50 root      0:00 {openresty} nginx: privileged agent process
      56 root      0:15 java -jar -Xmx4g -Xms4g /usr/local/apisix-runner-bin/apisix-java-plugin-runner.jar
   ```


-- 
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: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] tzssangglass commented on issue #78: bug: socket type file permissions not set accurately after apisix-java-plugin-runner automatically create this file when it starts

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #78:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/78#issuecomment-989714669


   > 这个问题我们也遇到了,排查半天,感觉太诡异了,socket权限应该设置为noboy才合理吧 ;(
   
   yes, PR is wolcome.


-- 
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: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] tzssangglass commented on issue #78: bug: socket type file permissions not set accurately after apisix-java-plugin-runner automatically create this file when it starts

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #78:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/78#issuecomment-986231043


   > 我在 docker 中通过 docker-compose 运行 APISXI,在运行模式下,仍然出现权限被拒绝
   
   see: https://github.com/apache/apisix/discussions/5628#discussioncomment-1713241


-- 
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: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] cws1981 commented on issue #78: bug: socket type file permissions not set accurately after apisix-java-plugin-runner automatically create this file when it starts

Posted by GitBox <gi...@apache.org>.
cws1981 commented on issue #78:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/78#issuecomment-981084264


   > 
   
   ```java
   Runtime.getRuntime().exec("chmod 777 " + socketFile);
   ```
   this is work for me.


-- 
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: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] BlackEragon commented on issue #78: bug: socket type file permissions not set accurately after apisix-java-plugin-runner automatically create this file when it starts

Posted by GitBox <gi...@apache.org>.
BlackEragon commented on issue #78:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/78#issuecomment-954457611


   I run APISXI through docker-compose in docker,on run mode,permission denied still occurs


-- 
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: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] tzssangglass commented on issue #78: bug: socket type file permissions not set accurately after apisix-java-plugin-runner automatically create this file when it starts

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #78:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/78#issuecomment-954414096


   1. on debug mode, the socket file is generated by Java plugin runner;
   2. on run mode, the socket file is generated by APISXI, so we don't need to set the file permissions by code, otherwise this code will cause an exception in run mode.


-- 
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: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] NUPT-Pig commented on issue #78: bug: socket type file permissions not set accurately after apisix-java-plugin-runner automatically create this file when it starts

Posted by GitBox <gi...@apache.org>.
NUPT-Pig commented on issue #78:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/78#issuecomment-956142232


   I have the same problem while running apisix in docker
   I seems default Permission is not “766” under folder /usr/local/apisix/conf/
   ----------------------------------------
   2021/11/01 11:04:45 [crit] 49#49: *14544 connect() to unix:/usr/local/apisix/conf/apisix-46.sock failed (13: Permission denied), client: 172.19.0.1, server: _, request: "GET /mdr_backend/msp/dashboard/ioa_company_info?insight_user=admin@msp&during_type=2 HTTP/1.1", host: "localhost:9080"
   


-- 
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: notifications-unsubscribe@apisix.apache.org

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