ERROR: "Couldn't refresh skeletons for remote interpreter"

A few months ago, I set up a remote deployment server (using ssh) and used a Conda environment configured there as a Python interpreter. This caused no problems even after the update to PyCharm Professional 2020.3.1. Yesterday, I deleted my project, interpreter and existing deployment configuration and created a new one (in order to set up a new project root and add some mappings).

In order, I:

  1. Created an SSH configuration.
  2. Created a remote interpreter using that SSH configuration.
  3. Followed the ensuing prompt to set up the remote deployment server (where I set up the mappings I required).

However, now I'm getting the following error:

Couldn't refresh skeletons for remote interpreter
failed to run generator3/__main__.py for sftp://anonymous@10.XX.XXX.XX:XX/home/anonymous/anaconda3/envs/cooccurrence/bin/python, exit code 1, stderr:
-----
Traceback (most recent call last):
File "/home/anonymous/.pycharm_helpers/generator3/__main__.py", line 167, in <module>
main()
File "/home/anonymous/.pycharm_helpers/generator3/__main__.py", line 114, in main
state_json = json.loads(sys.stdin.readline()) # utf-8 by default
File "/home/anonymous/anaconda3/envs/cooccurrence/lib/python3.8/json/__init__.py", line 357, in loads
return _default_decoder.decode(s)
File "/home/anonymous/anaconda3/envs/cooccurrence/lib/python3.8/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/home/anonymous/anaconda3/envs/cooccurrence/lib/python3.8/json/decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Invalid control character at: line 1 column 8193 (char 8192)
-----

To troubleshoot:

  1. I've tried deleting the interpreter and deployment configuration and creating them from scratch (as suggested by Andrew Resler here)
  2. Deleting the ~/.pycharm_helpers directory on my remote server and then creating everything from scratch.
  3. Restarting PyCharm a whole lot using File>Invalidate Caches/Restart (as suggested by Yuriri here)

None of these approaches have worked.Other threads online with similar problems are specific to Docker/Vagrant, which I'm not using.

I'm not sure exactly what I broke by deleting/recreating this. The only difference I can think of is that there are now two mappings set up for my project instead of just one, but I don't see how that could cause problems.

For reference, I'm running PyCharm on a Windows machine and SSHing to a RedHat remote server for deployment (where my interpreter is also located).

The traceback suggests that the json decoder issue might be a line separator issue (i.e. \n vs \r) but I'm not sure what I could do about that.

Please let me know how to fix this, or how I can provide more info to help!

Thanks :)

1
1 comment

Hi, it seems to be an issue with our skeleton generator script. Could you please submit an issue to https://youtrack.jetbrains.com/issues/py and provide the following information:

1. Your remote host OS and version

2. Conda and python version used on the remote host

3. Logs from **Help | Collect Logs and Diagnostic Data** after reproducing the issue

We will do our best to investigate.

0

Please sign in to leave a comment.