swyddfa / esbonio

A language server for working with Sphinx projects.
https://docs.esbon.io/
131 stars 21 forks source link

OSError: [Errno 30] Read-only file system: '/~' #342

Closed ssbarnea closed 2 years ago

ssbarnea commented 2 years ago

While trying to open one rst file in from a project:

[esbonio.lsp] Traceback (most recent call last):
  File "/Users/ssbarnea/.pyenv/versions/3.10.2/lib/python3.10/site-packages/esbonio/lsp/sphinx/__init__.py", line 261, in _initialize_sphinx
    return self.create_sphinx_app(self.user_config)
  File "/Users/ssbarnea/.pyenv/versions/3.10.2/lib/python3.10/site-packages/esbonio/lsp/sphinx/__init__.py", line 391, in create_sphinx_app
    app = Sphinx(
  File "/Users/ssbarnea/.pyenv/versions/3.10.2/lib/python3.10/site-packages/sphinx/application.py", line 237, in __init__
    ensuredir(outdir)
  File "/Users/ssbarnea/.pyenv/versions/3.10.2/lib/python3.10/site-packages/sphinx/util/osutil.py", line 73, in ensuredir
    os.makedirs(path, exist_ok=True)
  File "/Users/ssbarnea/.pyenv/versions/3.10.2/lib/python3.10/os.py", line 215, in makedirs
    makedirs(head, exist_ok=exist_ok)
  File "/Users/ssbarnea/.pyenv/versions/3.10.2/lib/python3.10/os.py", line 215, in makedirs
    makedirs(head, exist_ok=exist_ok)
  File "/Users/ssbarnea/.pyenv/versions/3.10.2/lib/python3.10/os.py", line 215, in makedirs
    makedirs(head, exist_ok=exist_ok)
  File "/Users/ssbarnea/.pyenv/versions/3.10.2/lib/python3.10/os.py", line 225, in makedirs
    mkdir(name, mode)
OSError: [Errno 30] Read-only file system: '/~'
lextm commented 2 years ago

You will have to provide some extra information, as this error seems to indicate that esbonio/sphinx cannot create the output directory (ensuredir(outDir)).

Which extension are you using? vscode-restructuredtext, or esbonio-vscode? What's your settings for this folder (at least esbonio.sphinx.buildDir)?

ssbarnea commented 2 years ago

It is a bit weird because originally I was using ... but I disabled it some time ago because it was not working with multi-root workspaces, and the caused was related to something missing in esbonio.

So yesterday when I opened a rst file, a new popup window from vscode appeared stating that "Now the RST support is provided by trond-snekvik.simple-rst extension, do you want to install". I did it and after it required me to clean some older settings from config file I ended up with error above.

There are no esbonio settings at user level and at workspace level, the settings.json seems to look like:

{
    "esbonio.sphinx.buildDir": "~/.cache/rst"
}

I mention that I did not configure this myself and that the settings appeared dimmed, due to "unknown configuration settings."

I am going to try disabling this extension and thy the "official" one instead and report the outcomes.

ssbarnea commented 2 years ago

I disabled the other rst exensions and only activate swyddfa.esbonio 1.8.0 one and the outcome seems almost the same:

[esbonio.lsp] Traceback (most recent call last):
  File "/Users/ssbarnea/.pyenv/versions/3.10.2/lib/python3.10/site-packages/esbonio/lsp/sphinx/__init__.py", line 261, in _initialize_sphinx
    return self.create_sphinx_app(self.user_config)
  File "/Users/ssbarnea/.pyenv/versions/3.10.2/lib/python3.10/site-packages/esbonio/lsp/sphinx/__init__.py", line 391, in create_sphinx_app
    app = Sphinx(
  File "/Users/ssbarnea/.pyenv/versions/3.10.2/lib/python3.10/site-packages/sphinx/application.py", line 237, in __init__
    ensuredir(outdir)
  File "/Users/ssbarnea/.pyenv/versions/3.10.2/lib/python3.10/site-packages/sphinx/util/osutil.py", line 73, in ensuredir
    os.makedirs(path, exist_ok=True)
  File "/Users/ssbarnea/.pyenv/versions/3.10.2/lib/python3.10/os.py", line 215, in makedirs
    makedirs(head, exist_ok=exist_ok)
  File "/Users/ssbarnea/.pyenv/versions/3.10.2/lib/python3.10/os.py", line 215, in makedirs
    makedirs(head, exist_ok=exist_ok)
  File "/Users/ssbarnea/.pyenv/versions/3.10.2/lib/python3.10/os.py", line 215, in makedirs
    makedirs(head, exist_ok=exist_ok)
  File "/Users/ssbarnea/.pyenv/versions/3.10.2/lib/python3.10/os.py", line 225, in makedirs
    mkdir(name, mode)
OSError: [Errno 30] Read-only file system: '/~'
Cancel notification for unknown message id "1"
alcarney commented 2 years ago

Looks like the language server can't handle paths with a ~ character in it. A workaround for now would be to switch this to an absolute path - which obviously is not ideal

alcarney commented 2 years ago

v0.10.1 of the language server is now out which hopefully resolves this issue. Feel free to re-open this if the problem persists after the update.