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

Daemon fails to start if it cannot write/access download directory #877

Closed
kauffj opened this issue Aug 29, 2017 · 14 comments
Closed

Daemon fails to start if it cannot write/access download directory #877

kauffj opened this issue Aug 29, 2017 · 14 comments

Comments

@kauffj
Copy link
Member

@kauffj kauffj commented Aug 29, 2017

Steps to Reproduce:

  • Stop daemon
  • Change the permissions on the download directory to 000 (e.g. chmod 000 ~/Downloads)
  • Start daemon

Error Trace:

2017-09-22 18:18:58,200 INFO     lbrynet.daemon.Daemon:471: Loading databases
2017-09-22 18:18:58,205 ERROR    lbrynet.daemon.DaemonControl:100: Failed to start lbrynet-daemon
Traceback (most recent call last):
  File "site-packages/lbrynet/daemon/DaemonControl.py", line 97, in start_server_and_listen
  File "site-packages/twisted/internet/defer.py", line 1297, in _inlineCallbacks
  File "site-packages/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator
  File "site-packages/lbrynet/daemon/DaemonServer.py", line 53, in start
  File "site-packages/twisted/internet/defer.py", line 1297, in _inlineCallbacks
  File "site-packages/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator
  File "site-packages/lbrynet/daemon/Daemon.py", line 251, in setup
  File "site-packages/twisted/python/threadpool.py", line 246, in inContext
  File "site-packages/twisted/python/threadpool.py", line 262, in <lambda>
  File "site-packages/twisted/python/context.py", line 118, in callWithContext
  File "site-packages/twisted/python/context.py", line 81, in callWithContext
  File "site-packages/lbrynet/daemon/Daemon.py", line 473, in _setup_data_directory
OSError: [Errno 13] Permission denied: '/home/miroslav/Videos/lbry'
2017-09-22 18:18:58,210 INFO     lbrynet.daemon.DaemonServer:57: Stopping the reactor

Copied from original issue: lbryio/lbry-desktop#495

@setenforce0
Copy link

@setenforce0 setenforce0 commented Sep 4, 2017

Can someone confirm that this is still an issue? Currently cannot reproduce

Loading

@mirgee
Copy link
Contributor

@mirgee mirgee commented Sep 22, 2017

This doesn't seem to be an issue anymore. On
{
"build": "dev",
"installation_id": "6QapiUUrkTfiks6jiQnecv8pXixxm1LncbgGB32x6nXpQ1aipjikPboVJM4UxsXruR",
"lbrynet_version": "0.16.1-4-g4a04018",
"lbryschema_version": "0.0.11rc1",
"lbryum_version": "3.1.7rc5",
"os_release": "4.10.0-35-generic",
"os_system": "Linux",
"platform": "Linux-4.10.0-35-generic-x86_64-with-Ubuntu-16.04-xenial",
"processor": "x86_64",
"python_version": "2.7.12"
}
the daemon rebuilds the file:
2017-09-22 09:15:34,572 INFO lbrynet.daemon.Daemon:1513: Already have lbry file but missing file in /home/miroslav/Videos/lbry, rebuilding it

This issue should be closed?

Loading

@Makgolli
Copy link

@Makgolli Makgolli commented Sep 22, 2017

Loading

@tzarebczan
Copy link
Member

@tzarebczan tzarebczan commented Sep 22, 2017

@mirgee I think you were referencing a rebuild of a particular LBRY download that's deleted, where-as this issue pertains to the entire downloads directory. So let's say the whole directory moved or is inaccessible (shared drive that's disconnected)

Loading

@tzarebczan
Copy link
Member

@tzarebczan tzarebczan commented Sep 22, 2017

@alexliebowitz - were you going to take a stab at this?

Loading

@mirgee
Copy link
Contributor

@mirgee mirgee commented Sep 22, 2017

@tzarebczan The app indeed tries to recreate the whole directory; when it has no permissions (or is inaccessible) the daemon crashes:

2017-09-22 18:18:58,200 INFO     lbrynet.daemon.Daemon:471: Loading databases
2017-09-22 18:18:58,205 ERROR    lbrynet.daemon.DaemonControl:100: Failed to start lbrynet-daemon
Traceback (most recent call last):
  File "site-packages/lbrynet/daemon/DaemonControl.py", line 97, in start_server_and_listen
  File "site-packages/twisted/internet/defer.py", line 1297, in _inlineCallbacks
  File "site-packages/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator
  File "site-packages/lbrynet/daemon/DaemonServer.py", line 53, in start
  File "site-packages/twisted/internet/defer.py", line 1297, in _inlineCallbacks
  File "site-packages/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator
  File "site-packages/lbrynet/daemon/Daemon.py", line 251, in setup
  File "site-packages/twisted/python/threadpool.py", line 246, in inContext
  File "site-packages/twisted/python/threadpool.py", line 262, in <lambda>
  File "site-packages/twisted/python/context.py", line 118, in callWithContext
  File "site-packages/twisted/python/context.py", line 81, in callWithContext
  File "site-packages/lbrynet/daemon/Daemon.py", line 473, in _setup_data_directory
OSError: [Errno 13] Permission denied: '/home/miroslav/Videos/lbry'
2017-09-22 18:18:58,210 INFO     lbrynet.daemon.DaemonServer:57: Stopping the reactor

Loading

@lyoshenka lyoshenka changed the title Daemon fails to start if download directory moved Daemon fails to start if it cannot write to download directory Oct 3, 2017
@tzarebczan
Copy link
Member

@tzarebczan tzarebczan commented Jan 17, 2018

@mirgee we can't reproduce this...were you ever able to? Closing it for now.

Loading

@tzarebczan tzarebczan closed this Jan 17, 2018
@tzarebczan
Copy link
Member

@tzarebczan tzarebczan commented May 2, 2018

Going to reopen, a user recently ran into this on his Mac. He had the download directory set in daemon_settings.yml

2018-04-28 15:22:52,755 INFO     lbrynet.daemon.Daemon:274: Platform: {"lbrynet_version": "0.19.1", "platform": "Darwin-17.5.0-x86_64-i386-64bit", "os_system": "Darwin", "python_version": "2.7.13", "os_release": "17.5.0", "lbryum_version": "3.2.0", "ip": "Could not determine IP", "lbryschema_version": "0.0.15", "processor": "i386", "build": "release"}
2018-04-28 15:22:52,767 INFO     lbrynet.daemon.Daemon:478: Loading databases
2018-04-28 15:22:52,772 ERROR    lbrynet.daemon.DaemonControl:113: Failed to start lbrynet-daemon
Traceback (most recent call last):
  File "site-packages/lbrynet/daemon/DaemonControl.py", line 110, in start_server_and_listen
  File "site-packages/twisted/internet/defer.py", line 1297, in _inlineCallbacks
  File "site-packages/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator
  File "site-packages/lbrynet/daemon/DaemonServer.py", line 51, in start
  File "site-packages/twisted/internet/defer.py", line 1297, in _inlineCallbacks
  File "site-packages/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator
  File "site-packages/lbrynet/daemon/Daemon.py", line 239, in setup
  File "site-packages/twisted/python/threadpool.py", line 246, in inContext
  File "site-packages/twisted/python/threadpool.py", line 262, in <lambda>
  File "site-packages/twisted/python/context.py", line 118, in callWithContext
  File "site-packages/twisted/python/context.py", line 81, in callWithContext
  File "site-packages/lbrynet/daemon/Daemon.py", line 480, in _setup_data_directory
OSError: [Errno 2] No such file or directory: '/Volumes/CRYP-1/Crypto-currencies/Wallets'

Loading

@eukreign
Copy link
Member

@eukreign eukreign commented Jan 28, 2019

@jackrobison can you add some integration tests for the blob exchange that properly handles missing directory and permission issues.

Loading

@tzarebczan
Copy link
Member

@tzarebczan tzarebczan commented Mar 2, 2019

This is still an issue, especially on Mac where the daemon fails to start entirely (won't even write to log) if the download directory is not available. I think the best thing to do is allow startup and just write to the default download directory for the session. It would be nice to alert the users that this changed/was unavailable...what if I unplugged my external, started LBRY, and then re-plugged it back in later - I should still be able to use it on a subsequent startup.

Loading

@tzarebczan tzarebczan changed the title Daemon fails to start if it cannot write to download directory Daemon fails to start if it cannot write/access to download directory Jun 28, 2019
@tzarebczan tzarebczan changed the title Daemon fails to start if it cannot write/access to download directory Daemon fails to start if it cannot write/access download directory Jun 28, 2019
@tzarebczan
Copy link
Member

@tzarebczan tzarebczan commented Jun 28, 2019

Had a few people fall victim to this over the last couple of weeks.

Loading

@eukreign
Copy link
Member

@eukreign eukreign commented Dec 13, 2019

daemon starts with inaccessible download directory (also, it will try to create it if it can)

Loading

@eukreign eukreign closed this Dec 13, 2019
@tzarebczan
Copy link
Member

@tzarebczan tzarebczan commented Apr 30, 2020

A user ran into this recently so I don't think it's fixed. Can we please add a test too if we fix it?

Loading

@lyoshenka
Copy link
Member

@lyoshenka lyoshenka commented Apr 20, 2021

closing in favor of #3270

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

9 participants