lbryio / lbry-sdk

The LBRY SDK for building decentralized, censorship resistant, monetized, digital content apps.
https://lbry.com
MIT License
7.19k stars 483 forks source link

Windows issue with get_paths and FOLDERID #1970

Open dvdvideo1234 opened 5 years ago

dvdvideo1234 commented 5 years ago

The Issue

The app crashes on a fresh install APPCRASH

Please see https://github.com/lbryio/lbry/issues/1970#issuecomment-480417753 for one reason this would crash. We need to fall back to a sane alternative if get_paths fails.

Steps to reproduce

  1. Install the app through the site
  2. Start the app

Expected behavior

App to actually launch ;)

Actual behavior

Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\DVD>cd C:\Program Files\LBRY

C:\Program Files\LBRY>LBRY.exe

C:\Program Files\LBRY> Starting SDK Sandbox listening on port 5278. Daemon: [5804] Failed to execute script cli

Daemon: Traceback (most recent call last): File "lbrynet\extras\cli.py", line 312, in File "lbrynet\extras\cli.py", line 231, in main File "lbrynet\conf.py", line 404, in create_from_arguments File "lbrynet\conf.py", line 549, in init File "lbrynet\conf.py", line 561, in set_default_paths File "lbrynet\conf.py", line 574, in get_windows_directories File "lbrynet\winpaths.py", line 152, in get_path lbrynet.winpaths.PathNotFoundException

System Configuration

Anything Else

image

Definition of Done

tzarebczan commented 5 years ago

Sorry to hear about the trouble. Which os are you on?

Did the app work before? Check your daemon_settings.yml file (same folder as logs) to check for invalid directories.

Otherwise check out https://lbry.io/faq/startup-troubleshooting for common issues. Email us at help@lbry.io if you continue to have issues.

tzarebczan commented 5 years ago

@dvdvideo1234 see this comment from a user who had the same issue: Problem solved! I patched my win win all new fixes and net frameworks and now working all! I think this have been some kind od net framework bug. Thank you all for effort!

dvdvideo1234 commented 5 years ago

@tzarebczan At least tell me:

  1. What did he install to make it work?
  2. Is there additional SW dependencies which the app needs?
  3. Would you mind giving me the solution information ?
dvdvideo1234 commented 5 years ago

It seems that it is actually a path problem

File "lbrynet\winpaths.py", line 152, in get_path lbrynet.winpaths.PathNotFoundException

tzarebczan commented 5 years ago

There are not normally any additional dependencies...this sounds like a problem local to your system and dot net installation. I'd make sure your windows update is all caught up and reinstall net framework packages.

dvdvideo1234 commented 5 years ago

Hmm, I do not seem to have the daemon_settings.yml in the install directory or in the entire C drive. Do you happen to know the location of this file? My dot net framework is the latest installed. I also have Win7 SP1. My .NET currently installed is 4.0

image

dvdvideo1234 commented 5 years ago

Actually, I got the install package from the website. https://lbry.io/get?src=PB

dvdvideo1234 commented 5 years ago

Hmm, it seems I need to install lbrynet and lbryum. I do not have both directories present. I do seem to have these folders missing, which is strange to be done by *.EXE installation. Uninstalling for now. Until maybe I attempt to try the latest version and compile it or whatever ;)

dvdvideo1234 commented 5 years ago

@tzarebczan

Could you please point me at least to the issue related to the following :

Problem solved! I patched my win win all new fixes and net frameworks and now working all! I think this have been some kind od net framework bug. Thank you all for effort!

tzarebczan commented 5 years ago

That was from a user on discord from a while. Also try installing https://www.microsoft.com/en-us/download/confirmation.aspx?id=49093&fbclid=IwAR2Gl1Qay34-_NnHpOSZm0VqMC9CQFish4vYXf4AQQ01cnJeE9ZDHdmInv0

tzarebczan commented 5 years ago

You don't have to 'install' those directories...they are created automatically if everything is working as it should.

dvdvideo1234 commented 5 years ago

I will provide you with feedback this evening

dvdvideo1234 commented 5 years ago

Well, that's unexpected.. image

dvdvideo1234 commented 5 years ago

I don't think that this can be closed just like that. This error has to be investigated.

tzarebczan commented 5 years ago

@dvdvideo1234, unfortunately, this is a local issue with your installation and not a problem with our software. We use a standard python LBRY to find the local path (winpaths). I've run this successfully on Windows 7. I'd recommend reinstalling net framework packages for Win 7 and maybe checking your environmental variables PATH to make sure there are no syntax errors.

dvdvideo1234 commented 5 years ago

I will provide you the value of my PATH variable. Could you tell me to compile this repo? I want to test this version

tzarebczan commented 5 years ago

@dvdvideo1234 I was finally able to reproduce this, at least with one user. His problem was that he moved his Windows Downloads folder to another location and our code didn't like that. Can you try to see if moving that back fixes for you too?

We need to handle https://github.com/lbryio/lbry/blob/ea4444edbea63f490fb3215a65ec13effb3ad17f/lbrynet/conf.py#L570 / https://github.com/lbryio/lbry/blob/ea4444edbea63f490fb3215a65ec13effb3ad17f/lbrynet/conf.py#L582 better in case it hits an exception. We could default to something like c:\LBRY\Downloads\ in that case.

dvdvideo1234 commented 5 years ago

No, sorry. The OS drive is intended for OS and I have dedicated drives in that manner, every one of my C:/ drive library ( pictures, music, documents, etc. ) folders are moved to drive O:/. Downloads have a dedicated 2TB drive P:/ and my windows %TEMP% and %TMP% folders are moved to my RamDrive for optimizing the SSD array write cycles count on drive K:/. In my opinion, an application should not care where is the actual folder located. I'd probably use std::getenv if in that manner, though this app is written in python and you must find something similar. Besides... I cannot just shift 2TB of data to my SSD.

tzarebczan commented 5 years ago

Yep, it's a bug and we'll get it fixed. Not a common scenario for most users.

Can we show you some appreciation for raising the issue?

dvdvideo1234 commented 5 years ago

@tzarebczan Yeah, feel free to do so ;) Contribution is what drives the open source community. To me defaulting the path to C:\LBRY\Downloads\ on exception rise is not an actual fix of the issue, because you are still relying on the fact that the user will have his downloads on C:\>, which for me is unacceptable. The easiest way for me to solve this issue is just to look in StackOverflow if someone has a similar problem and investigate the API it must call.

dvdvideo1234 commented 5 years ago

For example, if you have registry access you can read them from here. This is my Office machine: image

dvdvideo1234 commented 5 years ago

@tzarebczan Something like that maybe ... Have you ever considered using a folder selection dialog box ? The user can select the desired folder, you can store it in your APP... Problem solved. That way your hands get Untangled and you do not rely on the build-in Windows internal download paths, but considering the way the dialog will work, is that you first need to initialize the path with some default value like you said above ( Example: C:\LBRY\Downloads\ ), then give a choice to the user to modify this value. For example, Unix uses configurations files. Maybe you can use one of these and store the path in there.