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

No directory exists at 'electrum/www' #7089

Closed
sime opened this issue Mar 7, 2021 · 0 comments · Fixed by #7145
Closed

No directory exists at 'electrum/www' #7089

sime opened this issue Mar 7, 2021 · 0 comments · Fixed by #7145

Comments

@sime
Copy link

sime commented Mar 7, 2021

Following the docs on How to accept Bitcoin on a website using Electrum fails at rendering the payserver due to the www directory missing.

Interestingly, extracting Electrum-4.0.9.tar.gz, the electrum-http contents and be found in Electrum-4.0.9/electrum/www

Steps to reproduce:

/Applications/Electrum.app/Contents/MacOS/run_electrum -o setconfig payserver_address localhost:2029
/Applications/Electrum.app/Contents/MacOS/run_electrum daemon -v=warning

Output

I | logging | Electrum version: 4.0.9 - https://electrum.org - https://github.com/spesmilo/electrum
I | logging | Python version: 3.7.9 (default, Sep 11 2020, 17:18:37)
[Clang 11.0.0 (clang-1100.0.33.17)]. On platform: Darwin-19.6.0-x86_64-i386-64bit
I | logging | Logging to file: None
I | logging | Log filters: verbosity 'warning', verbosity_shortcuts ''
E | daemon.PayServer | Exception in run: ValueError("No directory exists at '/Applications/Electrum.app/Contents/Resources/electrum/www'")
Traceback (most recent call last):
  File "aiohttp/web_urldispatcher.py", line 553, in __init__
ValueError: Not a directory

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "electrum/util.py", line 1056, in wrapper
  File "electrum/daemon.py", line 341, in run
  File "aiohttp/web_app.py", line 333, in add_routes
  File "aiohttp/web_urldispatcher.py", line 1213, in add_routes
  File "aiohttp/web_routedef.py", line 100, in register
  File "aiohttp/web_urldispatcher.py", line 1126, in add_static
  File "aiohttp/web_urldispatcher.py", line 555, in __init__
ValueError: No directory exists at '/Applications/Electrum.app/Contents/Resources/electrum/www'

Similar error on Linux for a pip installed electrum instance

I | logging | Electrum version: 4.0.9 - https://electrum.org - https://github.com/spesmilo/electrum
I | logging | Python version: 3.6.9 (default, Jan 26 2021, 15:33:00)
[GCC 8.4.0]. On platform: Linux-5.9.6-x86_64-linode139-x86_64-with-Ubuntu-18.04-bionic
I | logging | Logging to file: None
I | logging | Log filters: verbosity 'warning', verbosity_shortcuts ''
E | daemon.PayServer | Exception in run: ValueError("No directory exists at '/root/.local/lib/python3.6/site-packages/electrum/www'",)
Traceback (most recent call last):
  File "/root/.local/lib/python3.6/site-packages/aiohttp/web_urldispatcher.py", line 553, in __init__
    raise ValueError("Not a directory")
ValueError: Not a directory

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/root/.local/lib/python3.6/site-packages/electrum/util.py", line 1056, in wrapper
    return await func(*args, **kwargs)
  File "/root/.local/lib/python3.6/site-packages/electrum/daemon.py", line 341, in run
    app.add_routes([web.static(root, os.path.join(os.path.dirname(__file__), 'www'))])
  File "/root/.local/lib/python3.6/site-packages/aiohttp/web_app.py", line 333, in add_routes
    return self.router.add_routes(routes)
  File "/root/.local/lib/python3.6/site-packages/aiohttp/web_urldispatcher.py", line 1213, in add_routes
    registered_routes.extend(route_def.register(self))
  File "/root/.local/lib/python3.6/site-packages/aiohttp/web_routedef.py", line 100, in register
    resource = router.add_static(self.prefix, self.path, **self.kwargs)
  File "/root/.local/lib/python3.6/site-packages/aiohttp/web_urldispatcher.py", line 1126, in add_static
    append_version=append_version,
  File "/root/.local/lib/python3.6/site-packages/aiohttp/web_urldispatcher.py", line 555, in __init__
    raise ValueError(f"No directory exists at '{directory}'") from error
ValueError: No directory exists at '/root/.local/lib/python3.6/site-packages/electrum/www'
@sime sime changed the title No directory exists at '/Applications/Electrum.app/Contents/Resources/electrum/www' No directory exists at 'electrum/www' Mar 7, 2021
SomberNight added a commit to SomberNight/electrum that referenced this issue Mar 27, 2021
…ages

(well, not everything, only files in electrum/ (so e.g. not contrib))
See comment in setup.py.

E.g. we have been including the www/ folder in the tar.gz but have not been installing it
to site-packages. Now we do.
Or we have been including the kivy GUI files in the tar.gz but not installing them.
Now we do.

I like this because it simplifies setup.py and should be easier to reason about too.

should fix spesmilo#7089 (at least when using the tar.gz)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants