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

Data Source always pending #361

Closed
wang14597 opened this issue May 7, 2022 · 4 comments
Closed

Data Source always pending #361

wang14597 opened this issue May 7, 2022 · 4 comments
Assignees
Labels

Comments

@wang14597
Copy link
Contributor

wang14597 commented May 7, 2022

Hi

I follow up Getting Started page set up a prod instance in Mac OS, and then I follow up Create & Run Indicators From Web App to create data source db-mysql, but it always pending.

image

image

I don't know why. I've tried many ways, but they haven't been solved.

thank you!

Look forward to your reply!

@alexisrolland alexisrolland self-assigned this May 8, 2022
@alexisrolland
Copy link
Member

Hello @wang14597

I was able to reproduce the issue. I am not sure why it happened. I am looking into it.

Thanks

@alexisrolland
Copy link
Member

alexisrolland commented May 8, 2022

Hello @wang14597

On the tutorial_mysql data source. Could you please click on the Logs button and tell me what do you see? I assume the logs are empty. Am I correct?

If the logs are empty, it is because the Docker container ran to test the data source connectivity was not able to connect to MobyDQ GraphQL API. This usually happens when the test container runs in a different Docker network than the one of the MobyDQ API container.

The test container is configured to run in a Docker network named mobydq_network. You can check the Docker network of your MobyDQ API using the following command: docker inspect mobydq-graphql -f "{{json .NetworkSettings.Networks }}". You should see something like the JSON below (the network name is the first key in the JSON, in this case mobydq_network):

{"mobydq_network":{"IPAMConfig":null,"Links":null,"Aliases":["mobydq-graphql","graphql","17a65748ac28"],"NetworkID":"7daf08ed2cca8a6b99a554d744fec5f0772972000e53aa9b7979facce5f76729","EndpointID":"f880b8576b86c5f7d5d4841ff2fa94372a9ea4b5ec6610f7acce76b16e311657","Gateway":"172.23.0.1","IPAddress":"172.23.0.6","IPPrefixLen":16,"IPv6Gateway":"","GlobalIPv6Address":"","GlobalIPv6PrefixLen":0,"MacAddress":"02:42:ac:17:00:06","DriverOpts":null}}

If your MobyDQ API container network is anything else than mobydq_network, this is likely the root cause of your issue. This typically happens if you renamed the the root folder of the repository mobydq into something else, because Docker uses the root folder name to create the network mobydq_network.

How To Fix

I am going to create a pull request to avoid this issue in the future, regardless of the folder name. Until then, you can fix this with the following:

Replace the content of the file docker-compose.yml with the following:

  • This enforces the creation of a default Docker network named to mobydq_network
  • This enforces each service to use the default network
version: "3.1"
services:
    db:
        container_name: mobydq-db
        restart: always
        image: mobydq-db
        build:
            context: ./db
        volumes:
            - db:/var/lib/postgresql/data
        env_file:
            - ./.env

    graphql:
        container_name: mobydq-graphql
        restart: always
        image: mobydq-graphql
        build:
            context: ./graphql
        volumes:
            - //var/run/docker.sock:/var/run/docker.sock
        env_file:
            - ./.env
        depends_on:
            - db

    app:
        container_name: mobydq-app
        restart: always
        image: mobydq-app
        build:
            context: ./app
        env_file:
            - ./.env
        depends_on:
            - graphql
        command: ["prod"]

    nginx:
        container_name: mobydq-nginx
        restart: always
        image: nginx:alpine
        volumes:
            - ./nginx/config/nginx.conf:/etc/nginx/nginx.conf
            - ./nginx/config/cert.pem:/etc/nginx/cert.pem
            - ./nginx/config/key.pem:/etc/nginx/key.pem
        ports:
            - 80:80
            - 443:443
        depends_on:
            - graphql

    scripts:
        container_name: mobydq-scripts
        restart: always
        image: mobydq-scripts
        build:
            context: ./scripts
            args:
                - MAIL_HOST=${MAIL_HOST}
                - MAIL_PORT=${MAIL_PORT}
                - MAIL_SENDER=${MAIL_SENDER}
                - MAIL_PASSWORD=${MAIL_PASSWORD}
                - MAIL_BASE_URL=${MAIL_BASE_URL}
        env_file:
            - ./.env
        depends_on:
            - graphql

networks:
    default:
        name: mobydq_network

volumes:
    db:

Replace the content of the file docker-compose.test.yml with the following. This enforces each service to use the default network.

version: "3.1"
services:
    db-cloudera:
        container_name: mobydq-test-db-cloudera
        image: mobydq-test-db-cloudera
        restart: always
        build:
            context: ./test/db-cloudera/
            dockerfile: Dockerfile
        expose:
            - 10000
        hostname: quickstart.cloudera
        privileged: true
        tty: true

    db-hortonworks:
        container_name: mobydq-test-db-hortonworks
        image: mobydq-test-db-hortonworks
        restart: always
        build:
            context: ./test/db-hortonworks/
            dockerfile: Dockerfile
        expose:
            - 10000
        hostname: sandbox-hdf.hortonworks.com
        privileged: true
        tty: true

    db-mariadb:
        container_name: mobydq-test-db-mariadb
        image: mobydq-test-db-mariadb
        restart: always
        build:
            context: ./test/db-mariadb/
            dockerfile: Dockerfile
        environment:
            MYSQL_ROOT_PASSWORD: "1234"
        expose:
            - 3306

    db-mysql:
        container_name: mobydq-test-db-mysql
        image: mobydq-test-db-mysql
        restart: always
        build:
            context: ./test/db-mysql/
            dockerfile: Dockerfile
        environment:
            MYSQL_ROOT_PASSWORD: "1234"
        expose:
            - 3306

    db-oracle:
        container_name: mobydq-test-db-oracle
        image: mobydq-test-db-oracle
        restart: always
        build:
            context: ./test/db-oracle/
            dockerfile: Dockerfile
        environment:
            ORACLE_PWD: "1234-abcd"
        expose:
            - 1521

    db-postgresql:
        container_name: mobydq-test-db-postgresql
        image: mobydq-test-db-postgresql
        restart: always
        build:
            context: ./test/db-postgresql/
            dockerfile: Dockerfile
        environment:
            POSTGRES_USER: "postgres"
            POSTGRES_PASSWORD: "1234"
            POSTGRES_DATABASE: "star_wars"
        expose:
            - 5432

    db-sql-server:
        container_name: mobydq-test-db-sql-server
        image: mobydq-test-db-sql-server
        restart: always
        build:
            context: ./test/db-sql-server/
            dockerfile: Dockerfile
        environment:
            ACCEPT_EULA: "Y"
            SA_PASSWORD: "1234-abcd"
        expose:
            - 1433

    test-scripts:
        container_name: mobydq-test-scripts
        image: mobydq-test-scripts
        build:
            context: .
            dockerfile: ./test/Dockerfile
        command: ["./run-tests.sh", "${TEST_CASE}", "${TEST_HOST}", "${TEST_PORT}"]
        depends_on:
          - db
          - graphql

    test-lint-python:
        container_name: mobydq-test-lint-python
        image: mobydq-test-lint-python
        build:
            context: .
            dockerfile: ./test/Dockerfile
        command: ["pylint", "scripts", "test"]

Please let me know if this fixes your issue?

Thanks

@wang14597
Copy link
Contributor Author

wang14597 commented May 9, 2022

Hi alexisrolland:

Thank you for your reply. I use your new docker-compose.yml and docker-compose.test.yml and set up a new instance in a Linux computer, it can work.

But it also can not work in my Mac OS computer, I suspect that my own computer may have some small problems.

So, I start to using MobyDQ in my Linux computer.

Please don't mind my bad English level, and thank you for your help!

Best wish!

@wang14597
Copy link
Contributor Author

I will close this issue.

Thank you again for your help

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

No branches or pull requests

2 participants