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

ValueError: Invalid dir_browser htdocs_path #246

Closed
ciupicri opened this issue Jan 20, 2022 · 17 comments
Closed

ValueError: Invalid dir_browser htdocs_path #246

ciupicri opened this issue Jan 20, 2022 · 17 comments

Comments

@ciupicri
Copy link

Describe the bug

wsgidav fails to start with the default configuration, probably because pip install does not install everything that's required.

To Reproduce

  1. Install it by running
pip3 install --user --use-feature=in-tree-build --compile --no-binary ":all" .
  1. Run
wsgidav --root=/usr/share/empty

Expected behavior

It should start.

Screenshots, Log-Files, Stacktrace

Running without configuration file.
Traceback (most recent call last):
  File "/home/ciupicri/.local/bin/wsgidav", line 8, in <module>
    sys.exit(run())
  File "/home/ciupicri/.local/lib/python3.10/site-packages/wsgidav/server/server_cli.py", line 803, in run
    app = WsgiDAVApp(config)
  File "/home/ciupicri/.local/lib/python3.10/site-packages/wsgidav/wsgidav_app.py", line 237, in __init__
    app = mw(self, self.application, config)
  File "/home/ciupicri/.local/lib/python3.10/site-packages/wsgidav/dir_browser/_dir_browser.py", line 60, in __init__
    raise ValueError(
ValueError: Invalid dir_browser htdocs_path '/home/ciupicri/.local/lib/python3.10/site-packages/wsgidav/dir_browser/htdocs'

Environment

WsgiDAV/4.0.1 Python/3.10.2(64 bit) Linux-5.15.15-200.fc35.x86_64-x86_64-with-glibc2.34
Python from: /usr/bin/python3
@ciupicri ciupicri added the bug label Jan 20, 2022
@mar10 mar10 removed the bug label Jan 21, 2022
@mar10
Copy link
Owner

mar10 commented Jan 21, 2022

This worked for me:

cd test_pip
test_pip % python -m venv .venv
test_pip % source .venv/bin/activate
test_pip % python -m pip install -U pip 
test_pip % python -m pip install wsgidav cheroot
test_pip % wsgidav --root . --auth anonymous --browse

@ciupicri
Copy link
Author

It works for me too, but you should also try it with the bleeding edge version, i.e. d22ada5.

Also in case it matters,

$ pip3 --version
pip 21.2.3 from /usr/lib/python3.10/site-packages/pip (python 3.10)

@djmattyg007
Copy link
Contributor

The issue is simple: the htdocs_path folder is not included in the .tar.gz archive uploaded to PyPI.

@djmattyg007
Copy link
Contributor

It doesn't even get installed when running python setup.py install in the root of this repo. The folder is only correctly installed when using the wheel published to PyPI.

@mar10 mar10 added the bug label Apr 6, 2022
mar10 added a commit that referenced this issue Apr 7, 2022
@mar10
Copy link
Owner

mar10 commented Apr 7, 2022

setup.py sdist worked for me on macOS, but for some reason not on the Windows box I use to build (because of the MSI istaller).
Adding it to options.data_files now, hope it doesn't break anything

@ciupicri
Copy link
Author

ciupicri commented Apr 8, 2022

I've updated to c83c2bd and reinstalled, but I'm still getting

Running without configuration file.
Traceback (most recent call last):
  File "/home/ciupicri/.local/bin/wsgidav", line 8, in <module>
    sys.exit(run())
  File "/home/ciupicri/.local/lib/python3.10/site-packages/wsgidav/server/server_cli.py", line 803, in run
    app = WsgiDAVApp(config)
  File "/home/ciupicri/.local/lib/python3.10/site-packages/wsgidav/wsgidav_app.py", line 237, in __init__
    app = mw(self, self.application, config)
  File "/home/ciupicri/.local/lib/python3.10/site-packages/wsgidav/dir_browser/_dir_browser.py", line 60, in __init__
    raise ValueError(
ValueError: Invalid dir_browser htdocs_path '/home/ciupicri/.local/lib/python3.10/site-packages/wsgidav/dir_browser/htdocs'

@rainerstandke
Copy link

For what's worth, I am seeing the same issue on a Raspberry Pi. Is there a work-around?

@ciupicri
Copy link
Author

ciupicri commented May 30, 2022

Yeah, create a symlink where it's needed pointing to that directory in the source code, e.g.
~/.local/lib/python3.10/site-packages/wsgidav/dir_browser/htdocs ->
~/github-repos/wsgidav/wsgidav/dir_browser/htdocs

Or just copy the whole thing.

@rainerstandke
Copy link

Thanks, Cristian!

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs.
Thank you for your contributions.

@github-actions github-actions bot added the stale label Aug 29, 2022
@ciupicri
Copy link
Author

I've just tested version c6b4fd7 and the issue is still present.

@ciupicri
Copy link
Author

I've just tested version 6c04339 and the issue is still present.

@mar10 mar10 reopened this Sep 15, 2022
mar10 added a commit that referenced this issue Sep 15, 2022
@mar10
Copy link
Owner

mar10 commented Sep 15, 2022

Can you give it another try?

@ciupicri
Copy link
Author

Version 721d85c works fine.

@mar10
Copy link
Owner

mar10 commented Sep 16, 2022

Thanks

@mar10 mar10 closed this as completed Sep 16, 2022
@ElFishi
Copy link

ElFishi commented Oct 13, 2022

I have the same problem.
Please excuse my ignorance (I have no clue about git, pip etc): how can I use install this version? Thx.

@ElFishi
Copy link

ElFishi commented Oct 13, 2022

sry, found it myself.
https://wsgidav.readthedocs.io/en/latest/installation.html#linux-macos

Or install the latest (potentially unstable) development version directly from GitHub:
$ pip install git+https://github.com/mar10/wsgidav.git

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

No branches or pull requests

5 participants