Eos: Docker image v1.0.9 is broken

Created on 11 Jul 2018  ·  6Comments  ·  Source: EOSIO/eos

Your latest docker image (v1.0.9) is broken. there were no changes in the Dockerfile, so I assume there is something wrong with the engine.

for example, after docker start I get ERROR 400: Bad Request

wget http://localhost:8888/v1/chain/get_info
--2018-07-11 07:25:56--  http://localhost:8888/v1/chain/get_info
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:8888... connected.
HTTP request sent, awaiting response... 400 Bad Request
2018-07-11 07:25:56 ERROR 400: Bad Request.
Support bug

Most helpful comment

Or you can set http-validate-host = false in your config for more consistent fix

All 6 comments

in 1.0.9 we enabled host header validation by default. It looks like this is causing problems for Docker as it has no configured aliases. As a work around you can try to add --header 'Host: 0.0.0.0:8888' to your curl command. I agree this is not ideal and we will try to fast forward a fix.

Or you can set http-validate-host = false in your config for more consistent fix

please try 1.0.10

Hi,

@wanderingbort same issue with docker 1.0.10

I'm totally new so I've started with v1.0.10, got the 400 Bad Request and Google led me here.

I also found I had to add the '--network host' flag to the docker run command.

Without that I kept seeing connect fails:

curl: (7) Failed to connect to localhost port 8888: Connection refused

Using the --header 'Host: 0.0.0.0:8888' works all good for me.

Here's some command line output for debugging.

❯ docker images
REPOSITORY            TAG                 IMAGE ID            CREATED             SIZE
eosio/eos-dev         latest              27100c04bcf5        3 hours ago         2.8GB
eosio/eos-dev         v1.0.10             27100c04bcf5        3 hours ago         2.8GB
❯ cleos version client
Build version: 3c6134c6
❯ curl -v http://localhost:8888/v1/chain/get_info                                                                                                                               *   Trying ::1...                                                                                                                                                               
* TCP_NODELAY set
* connect to ::1 port 8888 failed: Connection refused                      
*   Trying 127.0.0.1...                                                        
* TCP_NODELAY set                                                            
* Connected to localhost (127.0.0.1) port 8888 (#0)                           
> GET /v1/chain/get_info HTTP/1.1
> Host: localhost:8888         
> User-Agent: curl/7.58.0                                                        
> Accept: */*           
>                                    
< HTTP/1.1 400 Bad Request 
❯ curl -v -H 'Host: 0.0.0.0:8888' http://localhost:8888/v1/chain/get_info | jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying ::1...
* TCP_NODELAY set
* connect to ::1 port 8888 failed: Connection refused
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 8888 (#0)
> GET /v1/chain/get_info HTTP/1.1
> Host: 0.0.0.0:8888
> User-Agent: curl/7.58.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Access-Control-Allow-Origin: *
< Connection: close
< Content-Length: 533
< Content-type: application/json
< Server: WebSocket++/0.7.0
<
{ [533 bytes data]
100   533  100   533    0     0  88833      0 --:--:-- --:--:-- --:--:-- 88833
* Closing connection 0
{
  "server_version": "3c6134c6",
  "chain_id": "cf057bbfb72640471fd910bcb67639c22df9f92470936cddc1ade0e2f2e7dc4f",
  "head_block_num": 128,
  "last_irreversible_block_num": 127,
  "last_irreversible_block_id": "0000007f4a7508c9ae9d917d3d4d9f4d0468810812363f046c3ce1983d3540af",
  "head_block_id": "000000807ae3f82c4d0ecef3262ce74f285b668524836b8cc682c73e73a68464",
  "head_block_time": "2018-07-13T05:36:45.000",
  "head_block_producer": "eosio",
  "virtual_block_cpu_limit": 227032,
  "virtual_block_net_limit": 1190579,
  "block_cpu_limit": 199900,
  "block_net_limit": 1048576
}

Try adding --http-validate-host=false to your nodeos command above

I am having the same trouble, but on native Ubuntu not Docker.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zxf969175364 picture zxf969175364  ·  3Comments

williamleecn picture williamleecn  ·  3Comments

hoopslb picture hoopslb  ·  3Comments

Npizza picture Npizza  ·  3Comments

christola picture christola  ·  3Comments