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/08/20 13:32:04 UTC
[GitHub] [apisix-java-plugin-runner] RobertIndie opened a new issue #61: bug: Can not connect java plugin with apache apisix
RobertIndie opened a new issue #61:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/61
### Issue description
There are some issues when running the plugin in both Debug mode or Run mode.
In debug mode, the sock file does not seem to be successfully shared between the host and the container. So we get the connection refused exception when creating a request.
While in the run mode, it seems that the Java or the plugin file cannot be found by the apisix successfully in the container.
### Environment
* your apisix-java-plugin-runner version :0.1
* host-machine system: macos bigsur
### Minimal test code / Steps to reproduce the issue
* Followed the doc https://apisix.apache.org/docs/java-plugin-runner/development/ to implement a demo plugin
* Then we can get the jar file `apisix-java-plugin-runner.jar`
* Run the apache apisix according the doc: http://apisix.apache.org/docs/apisix/getting-started:
```sh
# Download the Docker image of Apache APISIX
git clone https://github.com/apache/apisix-docker.git
# Switch the current directory to the apisix-docker/example path
cd apisix-docker/example
# Run the docker-compose command to install Apache APISIX
docker-compose -p docker-apisix up -d
```
* Create a simple default route and add `ext-plugin-pre-req` plugin to that route.
* Then we tested the plugin in debug mode and run mode.
#### Run the plugin in the debug mode
1. Run the PluginRunnerApplication
2. Add some config in `apisix_conf/config.yml`:
```yaml
ext-plugin:
path_for_test: /tmp/runner.sock
```
3. Add a volume to share the sock file between the host and the apisix container:
```yaml
...
apisix:
image: apache/apisix:2.6-alpine
restart: always
volumes:
- ./apisix_log:/usr/local/apisix/logs
- ./apisix_conf/config.yaml:/usr/local/apisix/conf/config.yaml:ro
- /tmp/runner.sock:/tmp/runner.sock
... ...
```
4. Run curl to test the route, but we get the unexpected result:
```sh
➜ example git:(master) ✗ curl -i -X GET "http://localhost:9080/" -H "Host: example.com"
HTTP/1.1 503 Service Temporarily Unavailable
Date: Fri, 20 Aug 2021 12:51:29 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 194
Connection: keep-alive
Server: APISIX/2.6
<html>
<head><title>503 Service Temporarily Unavailable</title></head>
<body>
<center><h1>503 Service Temporarily Unavailable</h1></center>
<hr><center>openresty</center>
</body>
</html>
```
5. From the error.log file, we can see some log:
```sh
2021/08/20 13:02:23 [error] 47#47: *2374 connect() to unix:/tmp/runner.sock failed (111: Connection refused), client: 172.18.0.1, server: _, request: "GET / HTTP/1.1", host: "example.com"
2021/08/20 13:02:23 [error] 47#47: *2374 [lua] init.lua:536: phase_func(): failed to connect to the unix socket unix:/tmp/runner.sock: connection refused, client: 172.18.0.1, server: _, request: "GET / HTTP/1.1", host: "example.com"
2021/08/20 13:02:23 [warn] 47#47: *2374 [lua] plugin.lua:676: run_plugin(): ext-plugin-pre-req exits with http status code 503, client: 172.18.0.1, server: _, request: "GET / HTTP/1.1", host: "example.com"
2021/08/20 13:02:28 [error] 46#46: *2854 connect() to unix:/tmp/runner.sock failed (111: Connection refused), client: 172.18.0.1, server: _, request: "GET / HTTP/1.1", host: "example.com"
2021/08/20 13:02:28 [error] 46#46: *2854 [lua] init.lua:536: phase_func(): failed to connect to the unix socket unix:/tmp/runner.sock: connection refused, client: 172.18.0.1, server: _, request: "GET / HTTP/1.1", host: "example.com"
2021/08/20 13:02:28 [warn] 46#46: *2854 [lua] plugin.lua:676: run_plugin(): ext-plugin-pre-req exits with http status code 503, client: 172.18.0.1, server: _, request: "GET / HTTP/1.1", host: "example.com"
```
The `/tmp/runner.sock` file exists both in host and the apisix container:
From the host:
```sh
➜ example git:(master) ✗ ll /tmp/runner.sock
srwxr-xr-x 1 aaronrobert wheel 0B Aug 20 20:54 /tmp/runner.sock
➜ example git:(master) ✗ cat /tmp/runner.sock
➜ example git:(master) ✗
```
From the container:
```sh
/usr/local/apisix # ls -la /tmp/runner.sock
srwxr-xr-x 1 root root 0 Aug 20 12:54 /tmp/runner.sock
/usr/local/apisix # cat /tmp/runner.sock
cat: can't open '/tmp/runner.sock': No such device or address
```
But the file in the container seems weird.
#### Run the plugin in the run mode
1. Add some config in `apisix_conf/config.yml`:
```yaml
ext-plugin:
cmd: ['java', '-jar', '-Xmx4g', '-Xms4g', '/usr/local/apisix/test-plugin/apisix-java-plugin-runner.jar']
```
2. Mount the plugin file to the container:
```yaml
apisix:
image: apache/apisix:2.6-alpine
restart: always
volumes:
- ./apisix_log:/usr/local/apisix/logs
- ./apisix_conf/config.yaml:/usr/local/apisix/conf/config.yaml:ro
- /Users/xxx/codebase/apisix-java-plugin-runner/dist/apisix-runner-bin:/usr/local/apisix/test-plugin
```
3. When running the apisix, it outputs some errors in the error.log:
```sh
2021/08/20 12:39:26 [warn] 52#52: *155 [lua] init.lua:617: respawning new runner..., context: ngx.timer
2021/08/20 12:39:26 [error] 52#241: lua pipe child execvpe() failed while executing java (2: No such file or directory)
2021/08/20 12:39:26 [warn] 52#52: *155 [lua] init.lua:607: runner exited with reason: exit, status: 1, context: ngx.timer
2021/08/20 12:39:26 [warn] 52#52: *155 [lua] init.lua:549: flush conf token lrucache, context: ngx.timer
2021/08/20 12:39:26 [warn] 52#52: *155 [lua] init.lua:615: respawn runner 3 seconds later with cmd: ["java","-jar","-Xmx4g","-Xms4g","\/usr\/local\/apisix\/test-plugin\/apisix-java-plugin-runner.jar"], context: ngx.timer
```
4. The plugin jar file does exist in the container:
```sh
/usr/local/apisix/test-plugin # ls -la /usr/local/apisix/test-plugin/apisix-java-plugin-runner.jar
-rwxr-xr-x 1 root root 25681887 Aug 20 07:53 /usr/local/apisix/test-plugin/apisix-java-plugin-runner.jar
/usr/local/apisix/test-plugin # java
/bin/sh: java: not found
```
But it seems that java is not found.
### What's the actual result? (including assertion message & call stack if applicable)
* Please see above for the assertion message.
### What's the expected result?
* Return the HTTP response successfully.
--
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 #61: bug: Can not connect java plugin with apache apisix container
Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #61:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/61#issuecomment-978902832
Obviously this is a permissions issue with docker. I would recommend developing under linux.
--
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 #61: bug: Can not connect java plugin with apache apisix container
Posted by GitBox <gi...@apache.org>.
BlackEragon commented on issue #61:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/61#issuecomment-955853084
This is a solution to the problem of no jre in the container:rebuild APISIX image with alpine jre
···
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
··· Dockerfile
--
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 #61: bug: Can not connect java plugin with apache apisix
Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #61:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/61#issuecomment-902755392
1. in debug mode, `APISIX_LISTEN_ADDRESS=/tmp/runner.sock` just passes a path, the `/tmp/runner.sock` file is generated by apisix-java-plugin-runner, so I suspect that volume the `/tmp/runner.sock` file is not available, you could try mounting the `/tmp` directory.
2.
> ```shell
> java: not found
> ```
Is there no jdk in the container?
I think these problems are because APISIX and apisix-java-plugin-runner are not deployed in the same instance, pls take a look at: https://github.com/apache/apisix-java-plugin-runner/blob/main/docs/en/latest/the-internal-of-apisix-java-plugin-runner.md#communication.
--
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] RobertIndie commented on issue #61: bug: Can not connect java plugin with apache apisix
Posted by GitBox <gi...@apache.org>.
RobertIndie commented on issue #61:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/61#issuecomment-903827947
Thanks for your answer. It makes sense to me. @tzssangglass
I would like to change the issue title to make it more specific.
> Perhaps later we will provide images that can be run with apisix and apisix-java-plugin-runner.
I think this is a good point. Since the issue has been answered, do we need to close this issue? Or wait for this idea to be implemented?
--
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 #61: bug: Can not connect java plugin with apache apisix container
Posted by GitBox <gi...@apache.org>.
tzssangglass closed issue #61:
URL: 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 #61: bug: Can not connect java plugin with apache apisix
Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #61:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/61#issuecomment-903219223
> Is this related to this issue: [docker/for-mac#483](https://github.com/docker/for-mac/issues/483) ?
It should be.
> It seems that there is no JDK in the apisix.
of course, apisix is not a java project.
--
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 #61: bug: Can not connect java plugin with apache apisix container
Posted by GitBox <gi...@apache.org>.
cws1981 commented on issue #61:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/61#issuecomment-981081360
> Obviously this is a permissions issue with docker. I would recommend developing under linux.
> Obviously this is a permissions issue with docker. I would recommend developing under linux.
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] cws1981 edited a comment on issue #61: bug: Can not connect java plugin with apache apisix container
Posted by GitBox <gi...@apache.org>.
cws1981 edited a comment on issue #61:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/61#issuecomment-981081360
> Obviously this is a permissions issue with docker. I would recommend developing under linux.
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, the java process user is root, 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] cws1981 edited a comment on issue #61: bug: Can not connect java plugin with apache apisix container
Posted by GitBox <gi...@apache.org>.
cws1981 edited a comment on issue #61:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/61#issuecomment-981081360
> Obviously this is a permissions issue with docker. I would recommend developing under linux.
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] cws1981 edited a comment on issue #61: bug: Can not connect java plugin with apache apisix container
Posted by GitBox <gi...@apache.org>.
cws1981 edited a comment on issue #61:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/61#issuecomment-978884628
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,but when i running, it 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 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 edited a comment on issue #61: bug: Can not connect java plugin with apache apisix container
Posted by GitBox <gi...@apache.org>.
BlackEragon edited a comment on issue #61:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/61#issuecomment-955853084
This is a solution to the problem of no jre in the container:rebuild APISIX image with alpine jre
···
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
···
--
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 #61: bug: Can not connect java plugin with apache apisix container
Posted by GitBox <gi...@apache.org>.
cws1981 edited a comment on issue #61:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/61#issuecomment-981081360
> Obviously this is a permissions issue with docker. I would recommend developing under linux.
I use mac OS.
this is the processes in the docker 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, the java process user is root, 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] cws1981 edited a comment on issue #61: bug: Can not connect java plugin with apache apisix container
Posted by GitBox <gi...@apache.org>.
cws1981 edited a comment on issue #61:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/61#issuecomment-981081360
> Obviously this is a permissions issue with docker. I would recommend developing under linux.
I use mac OS.
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, the java process user is root, 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] RobertIndie commented on issue #61: bug: Can not connect java plugin with apache apisix
Posted by GitBox <gi...@apache.org>.
RobertIndie commented on issue #61:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/61#issuecomment-903234539
Thanks.
> of course, apisix is not a java project.
That confused me. According to the documentation, we need to let apisix run the java plugin runner. But how can we do this without jdk?
--
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 #61: bug: Can not connect java plugin with apache apisix container
Posted by GitBox <gi...@apache.org>.
cws1981 edited a comment on issue #61:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/61#issuecomment-978884628
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,but when i running, it 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 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 #61: bug: Can not connect java plugin with apache apisix container
Posted by GitBox <gi...@apache.org>.
cws1981 commented on issue #61:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/61#issuecomment-978884628
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,but when i running, it 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 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 #61: bug: Can not connect java plugin with apache apisix container
Posted by GitBox <gi...@apache.org>.
cws1981 edited a comment on issue #61:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/61#issuecomment-981081360
> Obviously this is a permissions issue with docker. I would recommend developing under linux.
I use mac OS.
this is the processes in the docker 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, the java process user is root, 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] cws1981 edited a comment on issue #61: bug: Can not connect java plugin with apache apisix container
Posted by GitBox <gi...@apache.org>.
cws1981 edited a comment on issue #61:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/61#issuecomment-981081360
> Obviously this is a permissions issue with docker. I would recommend developing under linux.
I user mac OS.
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, the java process user is root, 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] RobertIndie commented on issue #61: bug: Can not connect java plugin with apache apisix
Posted by GitBox <gi...@apache.org>.
RobertIndie commented on issue #61:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/61#issuecomment-903216292
> 1. in debug mode, `APISIX_LISTEN_ADDRESS=/tmp/runner.sock` just passes a path, the `/tmp/runner.sock` file is generated by apisix-java-plugin-runner, so I suspect that volume the `/tmp/runner.sock` file is not available, you could try mounting the `/tmp` directory.
I tried your solution, but still the same problem. I ran the apisix-java-plugin-runner first and then apisix. Is this related to this issue: https://github.com/docker/for-mac/issues/483 ?
>
> > ```shell
> > java: not found
> > ```
>
> Is there no jdk in the container?
>
> I think these problems are because APISIX and apisix-java-plugin-runner are not deployed in the same instance, pls take a look at: https://github.com/apache/apisix-java-plugin-runner/blob/main/docs/en/latest/the-internal-of-apisix-java-plugin-runner.md#communication.
I have mounted the file to the container. I deployed the apisix according to this doc: https://apisix.apache.org/docs/apisix/getting-started#step-1-install-apache-apisix. It seems that there is no JDK in the apisix.
--
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 #61: bug: Can not connect java plugin with apache apisix
Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #61:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/61#issuecomment-903236987
> That confused me. According to the documentation, we need to let apisix run the java plugin runner. But how can we do this without jdk?
[apisix.apache.org/docs/apisix/getting-started#step-1-install-apache-apisix](https://apisix.apache.org/docs/apisix/getting-started/#step-1-install-apache-apisix) is not for for apisix-java-plugin-runner, and docker-apisix is also not for apisix-java-plugin-runner.
you need to provide JDK to let apisix run the java plugin runner, even if they are in container.
Perhaps later we will provide images that can be run with apisix and apisix-java-plugin-runner.
--
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 #61: bug: Can not connect java plugin with apache apisix container
Posted by GitBox <gi...@apache.org>.
cws1981 edited a comment on issue #61:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/61#issuecomment-978884628
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,but when i running, it 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 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 edited a comment on issue #61: bug: Can not connect java plugin with apache apisix container
Posted by GitBox <gi...@apache.org>.
BlackEragon edited a comment on issue #61:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/61#issuecomment-955853084
This is a solution to the problem of no jre in the container:rebuild APISIX image with alpine jre
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
--
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