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

While running the Docker Image, the webui stays empty. #1807

Closed
ChristianKniep opened this issue Oct 6, 2015 · 14 comments
Closed

While running the Docker Image, the webui stays empty. #1807

ChristianKniep opened this issue Oct 6, 2015 · 14 comments
Labels
kind/bug A bug in existing code (including security flaws) topic/api Topic api topic/containers + vms

Comments

@ChristianKniep
Copy link
Contributor

When I start the docker image and access the webui, all content stays blank.
screen shot 2015-10-06 at 22 36 59

I build the container like this: $ dockerbuild --rm -t ipfs .
I started it like this:

$ docker run -d -p 8080:8080 -p 4001:4001 -p 5001:5001 ipfs
01d7169c1991f513c34caba652366dcf0b16b7940b16dbdd30c026395976d5b9

The logs read like this:

$ docker logs 01d7169c1991f513c34caba652366dcf0b16b7940b16dbdd30c026395976d5b9
Running ipfs version 0.3.8-dev...
initializing ipfs node at /data/ipfs
generating 2048-bit RSA keypair...done
peer identity: QmYp9iEHm6M43MGeEy62N3G7Rs4YMD1PLm4wiQhEhbbHyv
to get started, enter:

    ipfs cat /ipfs/QmVtU7ths96fMgZ8YSZAbKghyieq7AjxNdcqyVzxTt3qVe/readme

Initializing daemon...
Swarm listening on /ip4/127.0.0.1/tcp/4001
Swarm listening on /ip4/172.17.0.69/tcp/4001
Swarm listening on /ip6/::1/tcp/4001
API server listening on /ip4/0.0.0.0/tcp/5001
Gateway (readonly) server listening on /ip4/0.0.0.0/tcp/8080
Daemon is ready
time="20:34:46:000" level=error msg="Path Resolve error: no link named \"fontawesome-webfont.woff2\" under QmWjympWW8hpP5Jgfu66ZrqTMykUBjGbFQF2XgfChau5NZ" module="core/server"
time="20:34:49:000" level=error msg="Path Resolve error: no link named \"fontawesome-webfont.woff2\" under QmWjympWW8hpP5Jgfu66ZrqTMykUBjGbFQF2XgfChau5NZ" module="core/server"
time="20:34:53:000" level=error msg="Path Resolve error: no link named \"fontawesome-webfont.woff2\" under QmWjympWW8hpP5Jgfu66ZrqTMykUBjGbFQF2XgfChau5NZ" module="core/server"
time="20:34:54:000" level=error msg="Path Resolve error: no link named \"fontawesome-webfont.woff2\" under QmWjympWW8hpP5Jgfu66ZrqTMykUBjGbFQF2XgfChau5NZ" module="core/server"
time="20:35:02:000" level=error msg="Path Resolve error: no link named \"fontawesome-webfont.woff2\" under QmWjympWW8hpP5Jgfu66ZrqTMykUBjGbFQF2XgfChau5NZ" module="core/server"
time="20:36:25:000" level=error msg="Path Resolve error: no link named \"fontawesome-webfont.woff2\" under QmWjympWW8hpP5Jgfu66ZrqTMykUBjGbFQF2XgfChau5NZ" module="core/server"

The error message is rewritten each time a reload (CTRL-R) the page.

Creating a bash within the container and fireing up the following brings this:

$ ipfs config show
{
  "API": {
    "HTTPHeaders": null
  },
  "Addresses": {
    "API": "/ip4/0.0.0.0/tcp/5001",
    "Gateway": "/ip4/0.0.0.0/tcp/8080",
    "Swarm": [
      "/ip4/0.0.0.0/tcp/4001",
      "/ip6/::/tcp/4001"
    ]
  },
  "Bootstrap": [
    "/ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ",
    "/ip4/104.236.176.52/tcp/4001/ipfs/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z",
    "/ip4/104.236.179.241/tcp/4001/ipfs/QmSoLpPVmHKQ4XTPdz8tjDFgdeRFkpV8JgYq8JVJ69RrZm",
    "/ip4/162.243.248.213/tcp/4001/ipfs/QmSoLueR4xBeUbY9WZ9xGUUxunbKWcrNFTDAadQJmocnWm",
    "/ip4/128.199.219.111/tcp/4001/ipfs/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu",
    "/ip4/104.236.76.40/tcp/4001/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64",
    "/ip4/178.62.158.247/tcp/4001/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd",
    "/ip4/178.62.61.185/tcp/4001/ipfs/QmSoLMeWqB7YGVLJN3pNLQpmmEk35v6wYtsMGLzSr5QBU3",
    "/ip4/104.236.151.122/tcp/4001/ipfs/QmSoLju6m7xTh3DuokvT3886QRYqxAzb1kShaanJgW36yx"
  ],
  "Datastore": {
    "Path": "/data/ipfs/datastore",
    "Type": "leveldb"
  },
  "Discovery": {
    "MDNS": {
      "Enabled": true,
      "Interval": 10
    }
  },
  "Gateway": {
    "HTTPHeaders": null,
    "RootRedirect": "",
    "Writable": false
  },
  "Identity": {
    "PeerID": "QmYp9iEHm6M43MGeEy62N3G7Rs4YMD1PLm4wiQhEhbbHyv",
    "PrivKey": "CAASpwkwggSjAgEAAoIBAQDKAc9NscAD8qqU5ep7LvrnyuHTt+bvA1SUzcs5PJvh10TjthHl6axsczP+qMUSgjyI5D/1HLV36r0Q94RbRVcI7/9ZXmQWiua2ZouU6eTSYUNPidJnqOJzcjpZfgLjx7HJNH3UA+wWR3lpP1o6kXAJ13pppw7mq28b1qz42v4VTaxrr6Nrq5u5MGZwbjwG5azXfSUkGCrhVM/dEFk28jIoAEYxYcAlDc5r8/gHDKDIzAAfBQY9YbHhxXbS5aggA4F5t4H/aQEa2/+pGCN4UrLhpQ7LMrJhzCg60efPosYcr3wBXHOj3BemWD4F9tFUHMeimsEqbcFTXZUsUQIncwAvAgMBAAECggEBALmPSgc7lX/K5KkcPfVj5XUQ57qc/tRlgcei9uAf7a1aGlz2PaCtswZ4GLX//++NlN/Gk32sHoIGLiCszXctzdJW64ADdftDIsVAk016QQiD8dnZZ15zQ3j63+CfITZtlMGXp1IfPDoG898bI94TBRD1T+xHWifIKKsw2vlJ6QZVDgr7TB0EtOOzW/bUUtmdRs4A8Bf7Q7AusNeUPQl8WNOWKvPP7x9UXG0qWDSr4iUREvwZpzNSQ0pB3tojXGyWmRIRALJAv0126zfnnR1SPy3h89ZJkCeaYMoX7GKynDbgouZoawwAHKzX7WZ/HPis1KMHCGmz1XVBiozkA8De+fkCgYEA72gF5ZIJXTcG8S9ZC0+lG1JSmqXvVz5e1x1YBnLW0NHBSxv8m0c/nvxFg0RVJ4AX7jRW3l5l7Kyp5hUe6oURChp4hoxW3bXQBQ2pk2O8+u5NlIdT3s2k0atAlIKsUHeU0l2JwlEoie0/3ZgIq0Ym2nxdubw0gRlAq1YzEnhWdgsCgYEA2AIuiBOxXb2hiPnlYbZlnjVNc/SP92FpktnrON/NJJHxCBiX6OFymy+lLhOpQSO17ZZpXx5cDijnDUGkm7sOnDqt3GFWHGCX8/YceVfOOhL3ZktzZmJk0WYDpTvQD4EDtYMzizt6bY7S1w2bQ0G+Q92HFC0a8owyisR2dd6iKO0CgYAC2l1/n97msnots5+/B8Ly8Wc0mpeglYixzZK3+PRgZq+EAqBfBVlXvq/hYZYWM2uVliAW5E8Yo/IeYNAOgWlzkl8vU0rRt5H0DXag4AZngyF/jKFOPWsiaIULgAcnqlUmsKCspSTzh9VEAcTQrbRW1DaVuQ1zIGbp48wWA0McgwKBgHn+eXMm1BQiJhnrMI5H6go5Bl5HsAtBu9NROdSsKPrPZbZx1VGUChr1BLAKMJv2ZCgju60Zw1nH5f4JpcLCGVVImqqNWom6T/dbduddHL6VuZ3PXQRk65WLrOFj73TiI0sfJzwqQlGfyRnluFt6xM8lTMWrV73GSkEvBcw6CZFdAoGAUr9ePg+NGAJv43Zgeqz8K6SxvOd+n0P9Umo0WEA14K8HjCbbfurQVmoujq8sB9Ruvr2WWY97WizY81WIqSVSbgsA0/nIys1FUQkvvKs1xufo2+7qOKlLb1uqWfancasRP/sjZiSn7C8P8++dpLp85cwq5SAPe6QBjmAeQtl4Sek="
  },
  "Ipns": {
    "RecordLifetime": "",
    "RepublishPeriod": ""
  },
  "Log": {
    "MaxAgeDays": 0,
    "MaxBackups": 1,
    "MaxSizeMB": 250
  },
  "Mounts": {
    "FuseAllowOther": false,
    "IPFS": "/ipfs",
    "IPNS": "/ipns"
  },
  "SupernodeRouting": {
    "Servers": [
      "/ip4/104.236.176.52/tcp/4002/ipfs/QmXdb7tWTxdFEQEFgWBqkuYSrZd3mXrC7HxkD4krGNYx2U",
      "/ip4/104.236.179.241/tcp/4002/ipfs/QmVRqViDByUxjUMoPnjurjKvZhaEMFDtK35FJXHAM4Lkj6",
      "/ip4/104.236.151.122/tcp/4002/ipfs/QmSZwGx8Tn8tmcM4PtDJaMeUQNRhNFdBLVGPzRiNaRJtFH",
      "/ip4/162.243.248.213/tcp/4002/ipfs/QmbHVEEepCi7rn7VL7Exxpd2Ci9NNB6ifvqwhsrbRMgQFP",
      "/ip4/128.199.219.111/tcp/4002/ipfs/Qmb3brdCYmKG1ycwqCbo6LUwWxTuo3FisnJV2yir7oN92R",
      "/ip4/104.236.76.40/tcp/4002/ipfs/QmdRBCV8Cz2dGhoKLkD3YjPwVFECmqADQkx5ZteF2c6Fy4",
      "/ip4/178.62.158.247/tcp/4002/ipfs/QmUdiMPci7YoEUBkyFZAh2pAbjqcPr7LezyiPD2artLw3v",
      "/ip4/178.62.61.185/tcp/4002/ipfs/QmVw6fGNqBixZE4bewRLT2VXX7fAHUHs8JyidDiJ1P7RUN"
    ]
  },
  "Swarm": {
    "AddrFilters": null
  },
  "Tour": {
    "Last": ""
  },
  "Version": {
    "AutoUpdate": "minor",
    "Check": "error",
    "CheckDate": "0001-01-01T00:00:00Z",
    "CheckPeriod": "580780032",
    "Current": "0.3.8-dev"
  }
}
@ChristianKniep
Copy link
Contributor Author

On my MacBook the latest version 0.3.8-dev shows the same empty webpage. 0.3.7 works as expected...
Will update my docker image to check..

@ChristianKniep
Copy link
Contributor Author

On my docker images I can reproduce this error when changing to a newer version then 0.3.5. I put it in the README:
https://github.com/qnib/docker-ipfs

@jbenet
Copy link
Member

jbenet commented Oct 8, 2015

This sounds to me like a CORS issue. where are you accessing the webui from? from outside the docker node? (e.g. the docker host?)

i think you'll need to modify CORS according to ipfs daemon --help. let me know if we can improve the UX here, without compromising in security, and without yet going full web auth ( #1532 )

@whyrusleeping
Copy link
Member

we could use /sbin/ip route | awk '/default/ { print $3 }' in the containers to grab the ip of the docker host, and then set the CORS headers to allow just that ip

@em-ly em-ly added the kind/bug A bug in existing code (including security flaws) label Aug 25, 2016
@evanstucker-hates-2fa
Copy link

evanstucker-hates-2fa commented Jul 19, 2017

I have this issue as well.

In this example, my docker daemon where I run the IPFS container is a separate home server at 192.168.1.2. The workaround has two steps:

First, on the docker daemon, set the API and Gateway to 0.0.0.0 like this:

sudo docker exec ipfs_host ipfs config Addresses.Gateway /ip4/0.0.0.0/tcp/8080
sudo docker exec ipfs_host ipfs config Addresses.API /ip4/0.0.0.0/tcp/5001
sudo docker stop ipfs_host
sudo docker start ipfs_host
sudo docker logs -f ipfs_host

Wait for the log to show:

API server listening on /ip4/0.0.0.0/tcp/5001
Gateway (readonly) server listening on /ip4/0.0.0.0/tcp/8080
Daemon is ready

This will allow you to see the webui on your workstation at http://192.168.1.2:5001/webui, but it will still be blank.

Second, you need to forward your local ports to the 127.0.0.1 interface on your docker daemon with SSH:

ssh -L 4001:127.0.0.1:4001 -L 5001:127.0.0.1:5001 -L 8080:127.0.0.1:8080 192.168.1.2

Once you do that, you will be able to access the webui at http://127.0.0.1:5001/webui and it will be populated with info, but it will only work as long as that SSH tunnel is open...

It seems like there may be some in the webui or API somewhere that doesn't respect the setting of 0.0.0.0?

FYI:

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f6d769a8be79 ipfs/go-ipfs:latest "/sbin/tini -- /us..." About an hour ago Up 8 minutes 0.0.0.0:4001->4001/tcp, 0.0.0.0:5001->5001/tcp, 0.0.0.0:8080->8080/tcp, 4002/udp, 8081/tcp ipfs_host

@ChristianKniep
Copy link
Contributor Author

Still got the same issue running the current version. :(

@StepOITD
Copy link

Have anyone solved this problem yet ?

@lidel
Copy link
Member

lidel commented Sep 17, 2018

We are working on brand new version in revamp branch. It will support things like re-using API from IPFS Companion (which can be external one).

Stay tuned :)

@StepOITD
Copy link

@lidel I know it's strange but, my ipfs docker just worked and I really don't know why.

@StepOITD
Copy link

@lidel Emmmm, I'm not sure if it's due to some network change, yesterday I set up a local webui and it's not working, neither can I visit localhost:5001/webui, and my code using js-ipfs-api to get id keep getting network no response error, but today it suddently worked. I can now access lots of peers via ipfs swarm peers, but there's only few peers yesterday, is this anyhow related?

@StepOITD
Copy link

And I tried to cut of my network, still working...

@lidel
Copy link
Member

lidel commented Sep 18, 2018

@StepOITD really hard to tell without doing a deep dive into intricacies of your local setup, however usual suspects are:

  • old webui won't work when loaded from hostname different than localhost (it is a hardcoded limitation)
  • when you are running in docker it creates a private network (unless you pass --net=host) and you need to create port redirect from localhost to ipfs' IP in this new docker network -- I imagine this was broken in the past and you fixed it somehow

@lidel
Copy link
Member

lidel commented May 7, 2019

I believe this can be closed as the issue should solved in the latest webui:
https://github.com/ipfs-shipyard/ipfs-webui#configure-ipfs-api-cors-headers

@Stebalien
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws) topic/api Topic api topic/containers + vms
Projects
None yet
Development

No branches or pull requests

8 participants