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

Issue with Running docker contianer on single node #699

Closed
mayurthakur29 opened this issue Mar 18, 2019 · 7 comments
Closed

Issue with Running docker contianer on single node #699

mayurthakur29 opened this issue Mar 18, 2019 · 7 comments

Comments

@mayurthakur29
Copy link

mayurthakur29 commented Mar 18, 2019

i am running docker container on single host as below .

I am able to create API but unable to edit the API , as i check logs i am unable to get hit on WS container .

API logs are as below

2019-03-18 11:30:10,477 DEBUG [io.apicurio.hub.api.rest.impl.DesignsResource] (default task-30) Getting an API design with ID 2
2019-03-18 11:30:10,477 DEBUG [io.apicurio.hub.core.storage.jdbc.JdbcStorage] (default task-30) Selecting a single API Design: 2
2019-03-18 11:30:10,609 DEBUG [io.apicurio.hub.api.rest.impl.DesignsResource] (default task-30) Editing an API Design with ID 2
2019-03-18 11:30:10,609 DEBUG [io.apicurio.hub.api.rest.impl.DesignsResource] (default task-30)         USER: test
2019-03-18 11:30:10,609 DEBUG [io.apicurio.hub.core.storage.jdbc.JdbcStorage] (default task-30) Selecting the most recent api_content row of type 'document' for: 2
2019-03-18 11:30:10,617 DEBUG [io.apicurio.hub.core.storage.jdbc.JdbcStorage] (default task-30) Inserting an Editing Session UUID row: cdbdb812-2be8-4722-934c-acf1cf55356d
2019-03-18 11:30:10,751 DEBUG [io.apicurio.hub.api.rest.impl.DesignsResource] (default task-30)         Created Session ID: cdbdb812-2be8-4722-934c-acf1cf55356d
2019-03-18 11:30:10,751 DEBUG [io.apicurio.hub.api.rest.impl.DesignsResource] (default task-30)                     Secret: eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJuZXowemFfZHky
2019-03-18 11:30:15,402 DEBUG [io.apicurio.hub.api.rest.impl.DesignsResource] (default task-30) Getting an API design with ID 2
2019-03-18 11:30:15,402 DEBUG [io.apicurio.hub.core.storage.jdbc.JdbcStorage] (default task-30) Selecting a single API Design: 2
2019-03-18 11:30:15,465 DEBUG [io.apicurio.hub.api.rest.impl.DesignsResource] (default task-30) Editing an API Design with ID 2
2019-03-18 11:30:15,465 DEBUG [io.apicurio.hub.api.rest.impl.DesignsResource] (default task-30)         USER: test
2019-03-18 11:30:15,465 DEBUG [io.apicurio.hub.core.storage.jdbc.JdbcStorage] (default task-30) Selecting the most recent api_content row of type 'document' for: 2
2019-03-18 11:30:15,469 DEBUG [io.apicurio.hub.core.storage.jdbc.JdbcStorage] (default task-30) Inserting an Editing Session UUID row: 19b1eeb1-5ba5-494d-9ba0-135ceff8931b
2019-03-18 11:30:15,476 DEBUG [io.apicurio.hub.api.rest.impl.DesignsResource] (default task-30)         Created Session ID: 19b1eeb1-5ba5-494d-9ba0-135ceff8931b
2019-03-18 11:30:15,476 DEBUG [io.apicurio.hub.api.rest.impl.DesignsResource] (default task-30)                     Secret: eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJuZXowemFfZHky
  1. Mysql
docker run -itd -p 3306:3306 --name apicurio-mysql -e MYSQL_ROOT_PASSWORD=password -d mysql:5
docker exec -it apicurio-mysql mysql -h 10.0.0.13 -uroot -p
create database apicuriodb;
  1. keyclock
docker run -itd -p 8080:8080 -p 8443:8443 -e "APICURIO_UI_URL=http://10.0.0.13:8083/" apicurio/apicurio-studio-auth:latest-release
  1. Api
docker run -itd -p 8081:8080 -p 8444:8443 \
    -e "APICURIO_KC_AUTH_URL=http://10.0.0.13:8080/auth/" \
    -e "APICURIO_DB_DRIVER_NAME=mysql" \
    -e "APICURIO_DB_CONNECTION_URL=jdbc:mysql://10.0.0.13:3306/apicuriodb" \
    -e "APICURIO_DB_TYPE=mysql5" \
    -e "APICURIO_DB_USER_NAME=root" \
    -e "APICURIO_DB_PASSWORD=redhat" \
            -e "APICURIO_LOGGING_LEVEL=DEBUG" \
            -e "APICURIO_DB_INITIALIZE=true" \
    apicurio/apicurio-studio-api:latest-release
  1. ws
docker run -itd -p 8082:8080 -p 8445:8443 \
    -e "APICURIO_KC_AUTH_URL=http://10.0.0.13:8080/auth/" \
    -e "APICURIO_DB_DRIVER_NAME=mysql" \
    -e "APICURIO_DB_CONNECTION_URL=jdbc:mysql://10.0.0.13:3306/apicuriodb" \
    -e "APICURIO_DB_TYPE=mysql5" \
    -e "APICURIO_DB_USER_NAME=root" \
    -e "APICURIO_DB_PASSWORD=redhat" \
            -e "APICURIO_LOGGING_LEVEL=DEBUG" \
            -e "APICURIO_DB_INITIALIZE=true" \
    apicurio/apicurio-studio-ws:latest-release
  1. UI
docker run -itd -p 8083:8080 -p 8446:8443 \
    -e "APICURIO_KC_AUTH_URL=http://10.0.0.13:8080/auth" \
    -e "APICURIO_UI_HUB_API_URL=http://10.0.0.13:8081" \
    -e "APICURIO_UI_EDITING_URL=http://10.0.0.13:8082" \
            -e "APICURIO_KC_DISABLE_TRUST_MANAGER=false" \
            -e "APICURIO_KC_SSL_REQUIRED=none" \
            -e "APICURIO_LOGGING_LEVEL=DEBUG" \
    apicurio/apicurio-studio-ui:latest-release
@EricWittmann
Copy link
Member

What are the logs for the WS instance?

What happens in the UI?

Are there any errors or other relevant messages in the browser javascript console?

@Nicnl
Copy link

Nicnl commented Mar 20, 2019

Hey @mayurthakur29

I think there's something wrong with the configuration of your UI container, notably the APICURIO_UI_EDITING_URL environment variable

You've set it to http://10.0.0.13:8082
But it turns out that the UI container communicates to the WS container using websockets

Try to set it to APICURIO_UI_EDITING_URL=ws://10.0.0.13:8082

@Nicnl
Copy link

Nicnl commented Mar 20, 2019

Here is my docker-compose.yml for reference

version: '3'

services:

  apicurio-studio-mysql:
    image: 'percona:5.7'
    user: '1000'
    restart: always
    command: [
      '--character-set-server=utf8mb4',
      '--collation-server=utf8mb4_unicode_ci'
    ]
    environment:
      MYSQL_DATABASE: 'apicuriodb'
      MYSQL_ROOT_PASSWORD: 'root_password'
      MYSQL_USER: 'apicurio'
      MYSQL_PASSWORD: 'apicurio_password'
    volumes:
      - './data_mysql:/var/lib/mysql'


  apicurio-studio-ws:
    user: '1000'
    restart: always
    image: 'apicurio/apicurio-studio-ws:0.2.25.Final'
    depends_on: [apicurio-studio-mysql]
    ports:
      - '10.0.0.130:8092:8080'
    environment:
      JAVA_TOOL_OPTIONS: '-Djava.net.preferIPv4Stack=true'

      APICURIO_DB_TYPE: 'mysql5'
      APICURIO_DB_DRIVER_NAME: 'mysql'
      APICURIO_DB_CONNECTION_URL: 'jdbc:mysql://apicurio-studio-mysql/apicuriodb'
      APICURIO_DB_USER_NAME: 'apicurio'
      APICURIO_DB_PASSWORD: 'apicurio_password'
      APICURIO_DB_INITIALIZE: 'false'


  apicurio-studio-api:
    image: 'apicurio/apicurio-studio-api:0.2.25.Final'
    user: '1000'
    restart: always
    depends_on: [apicurio-studio-mysql, apicurio-studio-ws]
    ports:
      - '10.0.0.130:8091:8080'
    environment:
      JAVA_TOOL_OPTIONS: '-Djava.net.preferIPv4Stack=true'

      APICURIO_KC_AUTH_URL: 'http://10.0.0.130:8090/auth/'

      APICURIO_DB_TYPE: 'mysql5'
      APICURIO_DB_DRIVER_NAME: 'mysql'
      APICURIO_DB_CONNECTION_URL: 'jdbc:mysql://apicurio-studio-mysql/apicuriodb'
      APICURIO_DB_USER_NAME: 'apicurio'
      APICURIO_DB_PASSWORD: 'apicurio_password'
      APICURIO_DB_INITIALIZE: 'true'

      APICURIO_GITHUB_API_URL: ''
      APICURIO_GITLAB_API_URL: ''
      APICURIO_BITBUCKET_API_URL: ''


  apicurio-studio-ui:
    user: '1000'
    restart: always
    image: 'apicurio/apicurio-studio-ui:0.2.25.Final'
    depends_on: [apicurio-studio-mysql, apicurio-studio-api, apicurio-studio-ws]
    ports:
      - '10.0.0.130:8093:8080'
    environment:
      JAVA_TOOL_OPTIONS: '-Djava.net.preferIPv4Stack=true'

      APICURIO_KC_AUTH_URL: 'http://10.0.0.130:8090/auth/'
      APICURIO_UI_HUB_API_URL: 'http://10.0.0.130:8091'
      APICURIO_UI_EDITING_URL: 'ws://10.0.0.130:8092'

@EricWittmann
Copy link
Member

Thanks @Nicnl - any chance you'd like to contribute your docker compose to the project?

@mayurthakur29
Copy link
Author

Hey @mayurthakur29

I think there's something wrong with the configuration of your UI container, notably the APICURIO_UI_EDITING_URL environment variable

You've set it to http://10.0.0.13:8082
But it turns out that the UI container communicates to the WS container using websockets

Try to set it to APICURIO_UI_EDITING_URL=ws://10.0.0.13:8082

Thanks @Nicnl , issue got resolved after changing that part . to WS

@Nicnl
Copy link

Nicnl commented Mar 20, 2019

@EricWittmann

Absolutely, if I didn't want to contribute I wouldn't be posting it to help others
Though I'm not sure how you'd prefer this to be done
I suggest creating another issue in which we could discuss such a matter

@EricWittmann
Copy link
Member

Fair enough (and thanks). Issue here: #700

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

3 participants