Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker healthcheck fails in 8.3.0 #146

Open
cnoelle opened this issue Dec 7, 2022 · 1 comment
Open

Docker healthcheck fails in 8.3.0 #146

cnoelle opened this issue Dec 7, 2022 · 1 comment

Comments

@cnoelle
Copy link

cnoelle commented Dec 7, 2022

The container remains in status starting for some time then turns into unhealthy. This seems to be related to endpoint /iot/about being protected by access control, when probably it shouldn't. The service is available nevertheless, but this is quite misleading and worth fixing, in my opinion.

Start the container (requires an additional IDM service and env vars for the service to start successfully):

docker run --rm -d --name wilma -e PEP_PROXY_PORT=1027 fiware/pep-proxy:8.3.0

Login and run healtcheck script:

docker exec -it -u root wilma bash
node bin/healthcheck

The result is Performed health check, result 401.
The problem can be confirmed by installing curl in the container (apt update && apt install -y curl) and issuing a request:

curl http://localhost:1027/iot/about

Result:

{
    "type": "urn:dx:as:MissingAuthenticationToken",
    "title": "Unauthorized",
    "detail": "Auth-token not found in request header"
  }
@jason-fox
Copy link
Contributor

/iot/about is just a fallback if no PEP_PROXY_PUBLIC_PATHS have been defined. The default config.js just sets an empty array, so the health check needs to attempt to contact somewhere:

https://github.com/ging/fiware-pep-proxy/blob/master/bin/healthcheck.js#L18

Since the PEP Proxy is not tightly bound to any particular web service, the details of your preferred public path will vary depending upon which service you want to protect.

Set something like PEP_PROXY_PUBLIC_PATHS=version if you want to use the PEP Proxy with the Orion Context Broker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants