[GH-ISSUE #5] Invalid port specification: "None" #4

Closed
opened 2026-02-27 15:54:24 +03:00 by kerem · 14 comments
Owner

Originally created by @kirichenko on GitHub (Apr 6, 2017).
Original GitHub issue: https://github.com/RD17/ambar/issues/5

[root@searchbox ambar]# ./ambar.py start
 

______           ____     ______  ____       
/\  _  \  /'\_/`\/\  _`\  /\  _  \/\  _`\    
\ \ \L\ \/\      \ \ \L\ \ \ \L\ \ \ \L\ \  
 \ \  __ \ \ \__\ \ \  _ <'\ \  __ \ \ ,  /   
  \ \ \/\ \ \ \_/\ \ \ \L\ \ \ \/\ \ \ \ \  
   \ \_\ \_\ \_\ \_\ \____/ \ \_\ \_\ \_\ \_\
    \/_/\/_/\/_/ \/_/\/___/   \/_/\/_/\/_/\/ /


                                              
Docker version 1.12.1, build 23cf638
docker-compose version 1.12.0, build b31ff33
vm.max_map_count = 262144
net.ipv4.ip_local_port_range = 15000 61000
net.ipv4.tcp_fin_timeout = 30
net.core.somaxconn = 1024
net.core.netdev_max_backlog = 2000
net.ipv4.tcp_max_syn_backlog = 2048
Creating ambar_db_1
Creating ambar_rabbit_1
Creating ambar_es_1
Creating ambar_frontend_1

ERROR: for es  Cannot create container for service es: b'Invalid port specification: "None"'

ERROR: for db  Cannot create container for service db: b'Invalid port specification: "None"'

ERROR: for rabbit  Cannot create container for service rabbit: b'Invalid port specification: "None"'

ERROR: for frontend  Cannot create container for service frontend: b'Invalid port specification: "None"'
ERROR: Encountered errors while bringing up the project.
Traceback (most recent call last):
  File "./ambar.py", line 218, in <module>
    start(configuration)
  File "./ambar.py", line 187, in start
    runShellCommandStrict('docker-compose -f {0}/docker-compose.yml -p ambar up -d'.format(PATH))
  File "./ambar.py", line 45, in runShellCommandStrict
    subprocess.check_call(command, shell = True)
  File "/usr/local/lib/python3.5/subprocess.py", line 584, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'docker-compose -f /root/ambar/docker-compose.yml -p ambar up -d' returned non-zero exit status 1
Originally created by @kirichenko on GitHub (Apr 6, 2017). Original GitHub issue: https://github.com/RD17/ambar/issues/5 ``` [root@searchbox ambar]# ./ambar.py start ______ ____ ______ ____ /\ _ \ /'\_/`\/\ _`\ /\ _ \/\ _`\ \ \ \L\ \/\ \ \ \L\ \ \ \L\ \ \ \L\ \ \ \ __ \ \ \__\ \ \ _ <'\ \ __ \ \ , / \ \ \/\ \ \ \_/\ \ \ \L\ \ \ \/\ \ \ \ \ \ \_\ \_\ \_\ \_\ \____/ \ \_\ \_\ \_\ \_\ \/_/\/_/\/_/ \/_/\/___/ \/_/\/_/\/_/\/ / Docker version 1.12.1, build 23cf638 docker-compose version 1.12.0, build b31ff33 vm.max_map_count = 262144 net.ipv4.ip_local_port_range = 15000 61000 net.ipv4.tcp_fin_timeout = 30 net.core.somaxconn = 1024 net.core.netdev_max_backlog = 2000 net.ipv4.tcp_max_syn_backlog = 2048 Creating ambar_db_1 Creating ambar_rabbit_1 Creating ambar_es_1 Creating ambar_frontend_1 ERROR: for es Cannot create container for service es: b'Invalid port specification: "None"' ERROR: for db Cannot create container for service db: b'Invalid port specification: "None"' ERROR: for rabbit Cannot create container for service rabbit: b'Invalid port specification: "None"' ERROR: for frontend Cannot create container for service frontend: b'Invalid port specification: "None"' ERROR: Encountered errors while bringing up the project. Traceback (most recent call last): File "./ambar.py", line 218, in <module> start(configuration) File "./ambar.py", line 187, in start runShellCommandStrict('docker-compose -f {0}/docker-compose.yml -p ambar up -d'.format(PATH)) File "./ambar.py", line 45, in runShellCommandStrict subprocess.check_call(command, shell = True) File "/usr/local/lib/python3.5/subprocess.py", line 584, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command 'docker-compose -f /root/ambar/docker-compose.yml -p ambar up -d' returned non-zero exit status 1 ```
kerem closed this issue 2026-02-27 15:54:25 +03:00
Author
Owner

@sochix commented on GitHub (Apr 6, 2017):

Hello! Please post you config.json file

<!-- gh-comment-id:292133826 --> @sochix commented on GitHub (Apr 6, 2017): Hello! Please post you `config.json` file
Author
Owner

@kirichenko commented on GitHub (Apr 6, 2017):

[root@searchbox ambar]# cat config.json 
{
    "dockerComposeTemplate": "https://static.ambar.cloud/docker-compose.template.yml",
    "db": {
        "cacheSizeGb": 2
    },
    "api": {
        "pipelineCount": 1,
        "crawlerCount": 1,
        "cacheSize": "1g",
        "auth": "none",
        "defaultLangAnalyzer": "ambar_en",
        "analyticsToken": "cda4b0bb11a1f32aed7564b08c455992",
        "external": {
            "port": "8004",
            "host": "10.241.232.78",
            "protocol": "http"
        },
        "local": {
            "port": "8004",
            "host": "10.241.232.78",
            "protocol": "http"
        }
    },
    "es": {
        "containerSize": "2g",
        "heapSize": "1g"
    },
    "dataPath": "/opt/ambar",
    "dropbox": {
        "clientId": "",
        "redirectUri": ""
    },
    "fe": {
        "external": {
            "port": "80",
            "host": "10.241.232.78",
            "protocol": "http"
        },
        "local": {
            "port": "80",
            "host": "10.241.232.78",
            "protocol": "http"
        }
    },
    "dockerRepo": "ambar",
    "ocr": {
        "pdfSymbolsPerPageThreshold": 100,
        "pdfMaxPageCount": 5000
    }
}[root@searchbox ambar]#
<!-- gh-comment-id:292134105 --> @kirichenko commented on GitHub (Apr 6, 2017): ``` [root@searchbox ambar]# cat config.json { "dockerComposeTemplate": "https://static.ambar.cloud/docker-compose.template.yml", "db": { "cacheSizeGb": 2 }, "api": { "pipelineCount": 1, "crawlerCount": 1, "cacheSize": "1g", "auth": "none", "defaultLangAnalyzer": "ambar_en", "analyticsToken": "cda4b0bb11a1f32aed7564b08c455992", "external": { "port": "8004", "host": "10.241.232.78", "protocol": "http" }, "local": { "port": "8004", "host": "10.241.232.78", "protocol": "http" } }, "es": { "containerSize": "2g", "heapSize": "1g" }, "dataPath": "/opt/ambar", "dropbox": { "clientId": "", "redirectUri": "" }, "fe": { "external": { "port": "80", "host": "10.241.232.78", "protocol": "http" }, "local": { "port": "80", "host": "10.241.232.78", "protocol": "http" } }, "dockerRepo": "ambar", "ocr": { "pdfSymbolsPerPageThreshold": 100, "pdfMaxPageCount": 5000 } }[root@searchbox ambar]# ```
Author
Owner

@isido993 commented on GitHub (Apr 6, 2017):

Uh, that's quite strange... Please also post your generated docker-compose.yml file.
Thnx.

<!-- gh-comment-id:292134758 --> @isido993 commented on GitHub (Apr 6, 2017): Uh, that's quite strange... Please also post your generated docker-compose.yml file. Thnx.
Author
Owner

@kirichenko commented on GitHub (Apr 6, 2017):

[root@searchbox ambar]# cat docker-compose.yml 
version: "2"
services:
  webapi:
    restart: always
    image: ambar/ambar-webapi:latest
    expose:
      - "8080"
    ports:
      - "8004:8080"
    environment:
      - db=mongodb://db:27017/ambar_data
      - fe=http://10.241.232.78:80
      - api=http://10.241.232.78:8004
      - es=http://es:9200
      - redis=webapi-cache
      - rabbit=amqp://10.241.232.78
      - mode=prod
      - pipelineCount=1
      - crawlerCount=1
      - dropboxClientId=
      - dropboxRedirectUri=
      - defaultLangAnalyzer=ambar_en
      - analyticsToken=cda4b0bb11a1f32aed7564b08c455992
      - auth=none
      - ocrPdfMaxPageCount=5000
      - ocrPdfSymbolsPerPageThreshold=100
    depends_on:
      - db
      - rabbit
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
  webapi-cache:
    restart: always
    image: redis:alpine       
    expose:
      - "6379"
    ports:
      - "6379:6379"
    depends_on:
      - webapi   
    mem_limit: 1g 
  frontend:
    image: ambar/ambar-frontend:latest
    ports:
      - "80:80"
    restart: always
    environment:
      - api=http://10.241.232.78:8004
  db:
    restart: always
    image: ambar/ambar-mongodb:latest
    environment:
      - cacheSizeGB=2
    volumes:
      - /opt/ambar/db:/data/db
    ports:
      - "27017:27017"
    expose:
      - "27017"
  es:
    image: ambar/ambar-es:latest
    restart: always
    expose:
      - "9200"
    ports:
      - "9200:9200"
    environment:
      - cluster.name=ambar-es
      - bootstrap.memory_lock=true
      - xpack.security.enabled=false
      - security.manager.enabled=false
      - "ES_JAVA_OPTS=-Xms1g -Xmx1g"
    ulimits:
      memlock:
        soft: -1
        hard: -1  
      nofile:
        soft: 65536
        hard: 65536
    mem_limit: 2g
    cap_add:
      - IPC_LOCK
    volumes:
      - /opt/ambar/es:/usr/share/elasticsearch/data
  rabbit:
    image: ambar/ambar-rabbit:latest
    hostname: ambar-rabbit
    ports:
      - 15672:15672
      - 5672:5672
    volumes:
      - /opt/ambar/rabbit:/var/lib/rabbitmq

<!-- gh-comment-id:292135255 --> @kirichenko commented on GitHub (Apr 6, 2017): ``` [root@searchbox ambar]# cat docker-compose.yml version: "2" services: webapi: restart: always image: ambar/ambar-webapi:latest expose: - "8080" ports: - "8004:8080" environment: - db=mongodb://db:27017/ambar_data - fe=http://10.241.232.78:80 - api=http://10.241.232.78:8004 - es=http://es:9200 - redis=webapi-cache - rabbit=amqp://10.241.232.78 - mode=prod - pipelineCount=1 - crawlerCount=1 - dropboxClientId= - dropboxRedirectUri= - defaultLangAnalyzer=ambar_en - analyticsToken=cda4b0bb11a1f32aed7564b08c455992 - auth=none - ocrPdfMaxPageCount=5000 - ocrPdfSymbolsPerPageThreshold=100 depends_on: - db - rabbit volumes: - /var/run/docker.sock:/var/run/docker.sock webapi-cache: restart: always image: redis:alpine expose: - "6379" ports: - "6379:6379" depends_on: - webapi mem_limit: 1g frontend: image: ambar/ambar-frontend:latest ports: - "80:80" restart: always environment: - api=http://10.241.232.78:8004 db: restart: always image: ambar/ambar-mongodb:latest environment: - cacheSizeGB=2 volumes: - /opt/ambar/db:/data/db ports: - "27017:27017" expose: - "27017" es: image: ambar/ambar-es:latest restart: always expose: - "9200" ports: - "9200:9200" environment: - cluster.name=ambar-es - bootstrap.memory_lock=true - xpack.security.enabled=false - security.manager.enabled=false - "ES_JAVA_OPTS=-Xms1g -Xmx1g" ulimits: memlock: soft: -1 hard: -1 nofile: soft: 65536 hard: 65536 mem_limit: 2g cap_add: - IPC_LOCK volumes: - /opt/ambar/es:/usr/share/elasticsearch/data rabbit: image: ambar/ambar-rabbit:latest hostname: ambar-rabbit ports: - 15672:15672 - 5672:5672 volumes: - /opt/ambar/rabbit:/var/lib/rabbitmq ```
Author
Owner

@isido993 commented on GitHub (Apr 6, 2017):

I've just checked everything. It seems like a bug in Docker or (maybe, I'm not sure yet) docker-compose. So, first, try updating Docker to version 1.12.5 and re-run the script.

<!-- gh-comment-id:292136740 --> @isido993 commented on GitHub (Apr 6, 2017): I've just checked everything. It seems like a bug in Docker or (maybe, I'm not sure yet) docker-compose. So, first, try updating Docker to version 1.12.5 and re-run the script.
Author
Owner

@kirichenko commented on GitHub (Apr 6, 2017):

There is no Docker version 1.12.5 in yum repo (Centos 6.5).

# ./ambar.py start
 

______           ____     ______  ____       
/\  _  \  /'\_/`\/\  _`\  /\  _  \/\  _`\    
\ \ \L\ \/\      \ \ \L\ \ \ \L\ \ \ \L\ \  
 \ \  __ \ \ \__\ \ \  _ <'\ \  __ \ \ ,  /   
  \ \ \/\ \ \ \_/\ \ \ \L\ \ \ \/\ \ \ \ \  
   \ \_\ \_\ \_\ \_\ \____/ \ \_\ \_\ \_\ \_\
    \/_/\/_/\/_/ \/_/\/___/   \/_/\/_/\/_/\/ /


                                              
Docker version 1.12.6, build 78d1802
docker-compose version 1.12.0, build b31ff33
vm.max_map_count = 262144
net.ipv4.ip_local_port_range = 15000 61000
net.ipv4.tcp_fin_timeout = 30
net.core.somaxconn = 1024
net.core.netdev_max_backlog = 2000
net.ipv4.tcp_max_syn_backlog = 2048
Creating network "ambar_default" with the default driver
Creating ambar_rabbit_1
Creating ambar_es_1
Creating ambar_frontend_1
Creating ambar_db_1
Creating ambar_webapi_1
Creating ambar_webapi-cache_1
Waiting for Ambar to start...
Ambar is running on http://10.240.36.18:80

Ubuntu 16.10 - OK.

<!-- gh-comment-id:292140713 --> @kirichenko commented on GitHub (Apr 6, 2017): There is no Docker version 1.12.5 in yum repo (Centos 6.5). ``` # ./ambar.py start ______ ____ ______ ____ /\ _ \ /'\_/`\/\ _`\ /\ _ \/\ _`\ \ \ \L\ \/\ \ \ \L\ \ \ \L\ \ \ \L\ \ \ \ __ \ \ \__\ \ \ _ <'\ \ __ \ \ , / \ \ \/\ \ \ \_/\ \ \ \L\ \ \ \/\ \ \ \ \ \ \_\ \_\ \_\ \_\ \____/ \ \_\ \_\ \_\ \_\ \/_/\/_/\/_/ \/_/\/___/ \/_/\/_/\/_/\/ / Docker version 1.12.6, build 78d1802 docker-compose version 1.12.0, build b31ff33 vm.max_map_count = 262144 net.ipv4.ip_local_port_range = 15000 61000 net.ipv4.tcp_fin_timeout = 30 net.core.somaxconn = 1024 net.core.netdev_max_backlog = 2000 net.ipv4.tcp_max_syn_backlog = 2048 Creating network "ambar_default" with the default driver Creating ambar_rabbit_1 Creating ambar_es_1 Creating ambar_frontend_1 Creating ambar_db_1 Creating ambar_webapi_1 Creating ambar_webapi-cache_1 Waiting for Ambar to start... Ambar is running on http://10.240.36.18:80 ``` Ubuntu 16.10 - OK.
Author
Owner

@kirichenko commented on GitHub (Apr 6, 2017):

Not OK.
"Oops... Something went wrong. Please reload the page"
Reloading the page doesn't help.

<!-- gh-comment-id:292141324 --> @kirichenko commented on GitHub (Apr 6, 2017): Not OK. "Oops... Something went wrong. Please reload the page" Reloading the page doesn't help.
Author
Owner

@isido993 commented on GitHub (Apr 6, 2017):

Please open your browser console and post all the messages from there.
Btw, what browser are you using?

<!-- gh-comment-id:292145040 --> @isido993 commented on GitHub (Apr 6, 2017): Please open your browser console and post all the messages from there. Btw, what browser are you using?
Author
Owner

@kirichenko commented on GitHub (Apr 6, 2017):

  1. Failed to start. Error: TypeError: NetworkError when attempting to fetch resource.
  2. TypeError: NetworkError when attempting to fetch resource.
  3. Failed to auth. Error: TypeError: NetworkError when attempting to fetch resource.

Firefox 52.0.2

<!-- gh-comment-id:292157950 --> @kirichenko commented on GitHub (Apr 6, 2017): 1. Failed to start. Error: TypeError: NetworkError when attempting to fetch resource. 2. TypeError: NetworkError when attempting to fetch resource. 3. Failed to auth. Error: TypeError: NetworkError when attempting to fetch resource. Firefox 52.0.2
Author
Owner

@sochix commented on GitHub (Apr 6, 2017):

@kirichenko seems like frontend can't connec to to backend.
Try to open http://10.240.36.18:80:8004/api in your browser, and submit the response here.
Also check if your proxy did not block ports other than 80

<!-- gh-comment-id:292158653 --> @sochix commented on GitHub (Apr 6, 2017): @kirichenko seems like frontend can't connec to to backend. Try to open `http://10.240.36.18:80:8004/api` in your browser, and submit the response here. Also check if your proxy did not block ports other than 80
Author
Owner

@kirichenko commented on GitHub (Apr 6, 2017):

"Unable to connect"

<!-- gh-comment-id:292161117 --> @kirichenko commented on GitHub (Apr 6, 2017): "Unable to connect"
Author
Owner

@sochix commented on GitHub (Apr 6, 2017):

@kirichenko what the IP address of machine that you can reach? Does it equals 10.240.36.18? Or machine has several network interfaces?

<!-- gh-comment-id:292161770 --> @sochix commented on GitHub (Apr 6, 2017): @kirichenko what the IP address of machine that you can reach? Does it equals `10.240.36.18`? Or machine has several network interfaces?
Author
Owner

@kirichenko commented on GitHub (Apr 6, 2017):

Yes.
Fixed. Started firefox from root.

<!-- gh-comment-id:292162410 --> @kirichenko commented on GitHub (Apr 6, 2017): Yes. Fixed. Started firefox from root.
Author
Owner

@sochix commented on GitHub (Apr 6, 2017):

Nice!

<!-- gh-comment-id:292163095 --> @sochix commented on GitHub (Apr 6, 2017): Nice!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ambar#4
No description provided.