Solved

Getting 401 when I embed gooddata within docker-compose

  • 14 October 2021
  • 5 replies
  • 337 views

Trying to run our web app with Good Data embedded within a docker container.  They IP that is making the request is internal, http://172.19.0.4,  I believe this is why we are getting the 401 unauthorized access when we try to access the app.  The app works fine from outside the docker container.

Looking for suggestions on how to get around this problem or if anyone has encountered it

This is a snipit of our docker-compose file

 

version: '3'

services:
  server:
    build:
      context: .
      dockerfile: ./docker/server/Dockerfile
    container_name: server
    hostname: ${HOSTNAME}
    restart: unless-stopped
    ports:
      - "8000:8000"
      - "8080:8080"
  nginx:
    image: nginx:stable-alpine
    container_name: nginx
    hostname: nginx
    restart: unless-stopped
    command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - /data/var/docker/volumes/nginx_web/etc/nginx/conf.d:/etc/nginx/conf.d
      - /data/var/docker/volumes/certbot/etc/letsencrypt:/etc/letsencrypt
      - /data/var/docker/volumes/certbot/var/www/certbot:/var/www/certbot
  certbot:
    image: certbot/certbot
    container_name: certbot
    hostname: certbot
    restart: unless-stopped
    entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
    volumes:
      - /data/var/docker/volumes/certbot/etc/letsencrypt:/etc/letsencrypt
      - /data/var/docker/volumes/certbot/var/www/certbot:/var/www/certbot
  watchtower:
    image: containrrr/watchtower
    restart: always
    container_name: watchtower
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock

networks:
  default:
    external:
      name: holnet

icon

Best answer by Martin Burian 27 November 2021, 13:14

View original

5 replies

Hi Nuran, I know about the ticket related to this question - https://gooddata.zendesk.com/agent/tickets/103830. I have additional questions there. Honza Basko

Userlevel 2

If the application works fine outside the docker container and there are some issues once it is deployed to docker, then the issue will be somewhere in the configuration of the deployment which impacts the application.

Reason of the 401 is that the user is not authenticated. I recommend to check from where you get the 401. In case it is from GoodData, please check if the authentication itself fails or what is the request. This could help in investigation what is wrong and impacting the docker deployment.

Hi Nuran, I know about the ticket related to this question - https://gooddata.zendesk.com/agent/tickets/103830. I have additional questions there. Honza Basko

Hello, I’m trying to resolve this issue but for some reason I cannot open up this link. Was it possibly removed?

Userlevel 3

Hi Konstantin, 

 

The link was not removed, but I can see your user does not have enough rights to see its content. Can you please reach out to your colleague Nuran so he can share it with you?

 

Best, 

 

Moises

Hi Moises,

Thank you for your response! 

 

Cheers,

Konstantin

Reply