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
Labels
area: files good first issue hacktoberfest Welcome to Hacktoberfest help wanted level: 1 No knowledge of the existing code required priority: medium Work needs to be done within 2-3 sprints type: bug Existing functionality is wrong or broken

Comments

@kauffj
Copy link
Member

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

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

@kauffj kauffj added the type: bug Existing functionality is wrong or broken label Sep 19, 2017
@mirgee
Copy link
Contributor

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?

@Makgolli
Copy link

Makgolli commented Sep 22, 2017 via email

@tzarebczan
Copy link
Contributor

@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)

@tzarebczan
Copy link
Contributor

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

@mirgee
Copy link
Contributor

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

@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
@lyoshenka lyoshenka added needs level level: 1 No knowledge of the existing code required area: files good first issue and removed needs labels labels Jan 9, 2018
@tzarebczan
Copy link
Contributor

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

@tzarebczan
Copy link
Contributor

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'

@tzarebczan tzarebczan reopened this May 2, 2018
@alyssaoc alyssaoc added the hacktoberfest Welcome to Hacktoberfest label Sep 23, 2018
@eukreign
Copy link
Member

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

@tzarebczan
Copy link
Contributor

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.

@tzarebczan tzarebczan added the consider soon Discuss this issue at the next planning meeting, then remove this label label Mar 2, 2019
@alyssaoc alyssaoc added priority: medium Work needs to be done within 2-3 sprints and removed consider soon Discuss this issue at the next planning meeting, then remove this label labels Mar 4, 2019
@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 tzarebczan added the consider soon Discuss this issue at the next planning meeting, then remove this label label Jun 28, 2019
@tzarebczan
Copy link
Contributor

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

@eukreign
Copy link
Member

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

@tzarebczan
Copy link
Contributor

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?

@lyoshenka
Copy link
Member

closing in favor of #3270

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: files good first issue hacktoberfest Welcome to Hacktoberfest help wanted level: 1 No knowledge of the existing code required priority: medium Work needs to be done within 2-3 sprints type: bug Existing functionality is wrong or broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants