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

Doesn't work with Bandwidth Reporter disabled #893

Closed
sergeevabc opened this issue Apr 1, 2019 · 18 comments
Closed

Doesn't work with Bandwidth Reporter disabled #893

sergeevabc opened this issue Apr 1, 2019 · 18 comments

Comments

@sergeevabc
Copy link

Windows 7 x64 -> ipfs-desktop-setup-0.7.2.exe

Tray icon says IPFS is running, but clicking upon Status/Files/Settings outputs Is your IPFS daemon running? Failed to connect to the API. However I see ipfs.exe within processes listed in Windows Task Manager.

I have read advices below such as “allow cross-origin”, but provided command ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["webui://-", "http://127.0.0.1:5001", "https://webui.ipfs.io"]' throws error “Error: Unknown Command "API.HTTPHeaders.Access-Control-Allow-Origin".

Thus, I’m confused.

@hacdias
Copy link
Member

hacdias commented Apr 2, 2019

That's curious. I can't reproduce your issue on Windows 10. Have you changed any configuration/did you have a repository before installing IPFS Desktop? Or this is your first time installing IPFS?

@sergeevabc
Copy link
Author

@hacdias, first time user, yes. Even turned off built-in Windows firewall just in case. It is regrettable there is no bootstrapping log to provide for easier troubleshooting since …\IPFS Desktop\logs is empty and other two log-like files contain vague information as follows.

$ cat combined.log
2019-04-02T09:30:39.950Z error: net::ERR_EMPTY_RESPONSE
2019-04-02T09:30:42.392Z info: [web ui] window ready
2019-04-02T09:30:42.393Z info: [tray] starting
2019-04-02T09:30:42.701Z info: [tray] started
2019-04-02T09:30:42.703Z info: [ipfsd] starting daemon
2019-04-02T09:30:51.425Z info: [ipfsd] daemon started
2019-04-02T09:30:51.529Z info: [hash download] shortcut disabled
2019-04-02T09:30:51.530Z info: [screenshot] shortcut disabled
2019-04-02T09:30:51.577Z info: [launch on startup] disabled
2019-04-02T09:31:41.689Z info: [web ui] navigate to /

$ cat error.log
2019-04-02T09:30:39.950Z error: net::ERR_EMPTY_RESPONSE

@hacdias
Copy link
Member

hacdias commented Apr 3, 2019

Are you using Windows Subsystem for Linux? How did you run ipfs command if IPFS Desktop doesn't provide the CLI (yet)? You seem to already have IPFS running on your computer somehow.

@sergeevabc
Copy link
Author

@hacdias, -_-
My OS was stated clearly in the beginning, it is Windows 7, it has no Linux Subsystem.
And I never run any ipfs commands via command-line interface.
What I did is switched off IPFS Desktop, went to its logs folder and shared its contents with you.

@hacdias
Copy link
Member

hacdias commented Apr 5, 2019

I have read advices below such as “allow cross-origin”, but provided command ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["webui://-", "http://127.0.0.1:5001", "https://webui.ipfs.io"]' throws error “Error: Unknown Command "API.HTTPHeaders.Access-Control-Allow-Origin".

How did you run that? We don't provide the ipfs CLI.

Could you try killing all ipfs-related processes in taskmgr and restart IPFS Desktop, please?

@NatoBoram
Copy link

NatoBoram commented Apr 6, 2019

Confirmed here, it doesn't work out of the box anymore.

OS: Windows 10 Pro x86_64
Host: System manufacturer
Kernel: 2.11.2(0.329/5/3)
Uptime: 11 hours, 21 mins
Shell: bash 4.4.23
Resolution: 1920x1080
DE: Aero
WM: Explorer
WM Theme: Roamed
CPU: Intel i5-3570K (4) @ 3.410GHz
GPU: NVIDIA GeForce GTX 660 Ti
Memory: 6411MiB / 8135MiB

image

Also, those two commands...

$ ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["webui://-", "http://127.0.0.1:5001", "https://webui.ipfs.io"]'
$ ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "GET", "POST"]'

Here's their output :

ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["webui://-", "http://127.0.0.1:5001", "https://webui.ipfs.io"]'
Error: Unknown Command "API.HTTPHeaders.Access-Control-Allow-Origin"


USAGE
  ipfs config <key> [<value>] - Get and set ipfs config values.

  ipfs config [--bool] [--json] [--] <key> [<value>]

  'ipfs config' controls configuration variables. It works like 'git config'.
  The configuration values are stored in a config file inside your ipfs
  repository.

SUBCOMMANDS
  ipfs config edit           - Open the config file for editing in $EDITOR.
  ipfs config profile        - Apply profiles to config.
  ipfs config replace <file> - Replace the config with <file>.
  ipfs config show           - Output config file contents.

Use 'ipfs config --help' for more information about this command.
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "GET", "POST"]'
Error: Unknown Command "API.HTTPHeaders.Access-Control-Allow-Methods"


USAGE
  ipfs config <key> [<value>] - Get and set ipfs config values.

  ipfs config [--bool] [--json] [--] <key> [<value>]

  'ipfs config' controls configuration variables. It works like 'git config'.
  The configuration values are stored in a config file inside your ipfs
  repository.

SUBCOMMANDS
  ipfs config edit           - Open the config file for editing in $EDITOR.
  ipfs config profile        - Apply profiles to config.
  ipfs config replace <file> - Replace the config with <file>.
  ipfs config show           - Output config file contents.

Use 'ipfs config --help' for more information about this command.

However, IPFS Companion's WebUI does work.

Here's the logs I've got :

Failed to connect to ipfs-api /ip4/127.0.0.1/tcp/5001
4.56d25521.chunk.js:1 Trying IPFS Companion
4.56d25521.chunk.js:1 🎛️ Customise your js-ipfs-api options by storing a `ipfsApi` object in localStorage. e.g. localStorage.setItem('ipfsApi', '/ip4/127.0.0.1/tcp/5001')
4.56d25521.chunk.js:1 Trying ipfs-api with custom api address /ip4/127.0.0.1/tcp/5001
bw:1 Failed to load resource: the server responded with a status of 503 (Connect failed)

Failed to connect to ipfs-api /ip4/127.0.0.1/tcp/5001
4.56d25521.chunk.js:1 Trying IPFS Companion
4.56d25521.chunk.js:1 🎛️ Customise your js-ipfs-api options by storing a `ipfsApi` object in localStorage. e.g. localStorage.setItem('ipfsApi', '/ip4/127.0.0.1/tcp/5001')
4.56d25521.chunk.js:1 Trying ipfs-api with custom api address /ip4/127.0.0.1/tcp/5001
4.56d25521.chunk.js:1 POST http://127.0.0.1:5001/api/v0/stats/bw?stream-channels=true 503 (Connect failed)

If I open the address in the failed POST, I get this :

{"TotalIn":1720,"TotalOut":1867,"RateIn":0.06946260261127944,"RateOut":0.07571170228100346}

I even deleted .ipfs and the result is still the same.

That's curious. I can't reproduce your issue on Windows 10.

Perhaps it's time for a fresh install?

@hacdias
Copy link
Member

hacdias commented Apr 6, 2019

My steps:

  • Install Windows 10 64 bits Pro on a VM
  • Download IPFS Desktop from GitHub Releases (link)
  • Run binary
  • Agreed on Firewall only on private networks
  • Wait for it to start
  • Click 'Status'

Result:

image

Anything you think that might be causing this?

Also tried on my other Windows computer and it works just fine.


About the commands, yes, they seem not to be working on Windows. They were supposed to work though. It seems the command is not working on PowerShell, neither on CMD (source). I'll investigate this more.

@NatoBoram
Copy link

Ugh, what a pain. I have no idea what can cause this, I'm running a fresh build that I installed literally three days ago. Even in my old Windows installation, it stopped working a few weeks ago.

@hacdias
Copy link
Member

hacdias commented Apr 8, 2019

Yeah, this is a weird situation. Do you know more or less in which version it stopped working? Did it stop working with an already existing IPFS repo?

@NatoBoram
Copy link

Nope. It just stopped working after an update. I tried both an existing repo and without a repo, with badgerds and flatfs, installed from Scoop and installed from the installer, and now from a fresh Windows 10 installation.

@hacdias
Copy link
Member

hacdias commented Apr 10, 2019

I tried the exact same situations and didn't have any issue. Let's bring someone else! @djdv, could you please try to see if you can reproduce this issue? Thanks 😃

@djdv
Copy link

djdv commented Apr 10, 2019

Okay so, without ipfs-desktop. I was unable to connect to the webui using my go-ipfs daemon, but these where unrelated (ipfs/ipfs-webui#1008, ipfs/ipfs-webui#1009) and already mentioned above. It had to do with my custom configuration.

I installed an instance of latest version of Windows (10 1903 18362.53), installed ipfs-desktop, and had no issues with a fresh profile.
desktop

For people having the issue, can you open the ipfs-desktop status window, open the console (ctrl+shift+i), reload the page (ctrl+r), and see if you encounter any error similar to this: ipfs/ipfs-webui#1009

@NatoBoram
Copy link

Oh, that worked for me. I though I had enabled everything after creating the node, but it looks like it wasn't the case.

So... Shouldn't IPFS Desktop try to launch this command in the background if it can't connect to the node?

@djdv
Copy link

djdv commented Apr 10, 2019

In my case, I went from a non-existing ipfs-config, and let ipfs-desktop initialize the profile. It seems like if you have an existing profile, nothing is modified.
https://github.com/ipfs-shipyard/ipfs-desktop/blob/19a8793cc7e7b8ccbbce794fad46ca23fa450d00/src/utils/daemon.js#L55-L57

So currently, you either need a modern default config already, or you have to set those values yourself.

Shouldn't IPFS Desktop try to launch this command in the background if it can't connect to the node?

It seems like it would be useful to have an option that applies required settings to the config file. Basically a "Reset config" option during install, or a menu item under Advanced, etc.
But imo we should not override the config values automatically, without prompting the user.

@NatoBoram
Copy link

So just adding that command to the interface, where the two others are, should be enough.

@sergeevabc
Copy link
Author

@NatoBoram, “that command, that command”, let’s say it loud and clear:
ipfs config --json Swarm.DisableBandwidthMetrics false

@hacdias
Copy link
Member

hacdias commented Apr 10, 2019

Thanks for debugging this @djdv. I think that the best option is to show in Web UI some kind of message in this situations instead of blacking out. What do you think @olizilla?

We could, perhaps, make Web UI "tell" Desktop somehow of this issue, and ask the user their permission to automatically change the configuration instead of them doing it manually.

@sergeevabc sergeevabc changed the title Does not work on Windows out of the box [PENDING] Does not work on Windows out of the box Apr 20, 2019
@hacdias hacdias changed the title [PENDING] Does not work on Windows out of the box Doesn't work with Bandwidth Reporter disabled Apr 28, 2019
@hacdias
Copy link
Member

hacdias commented Apr 30, 2019

Fixed on ipfs/ipfs-webui#1024 😃

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

4 participants