CLion problems with new Core 5.1.1·Home 3.3.4

I installed CLion and PlatformIO on a new W10 computer. There are lot of problems (it was working fine with older version of PlatformIO / CLion on another computer).
The most annoying and blocking one is to add libraries to compile Wemos programs.
Now that we have to add libraries for each project,
I don’t know if it is a Chrome restriction access or windows but a Chrome page on http://127.0.0.1:8008/ can’t add a library, it find them, propose to add them but run forever without adding them.
Whereas I tried with VSCode, and it works.
if I copy the libraries added by VSCode to the project of CLion, it can compile using CLion/PlatformIO
Any ideas ?

If there is a regression, please file a bug in https://youtrack.jetbrains.com/issues?q=tag:%20platformio with the tag platformio.

they tell me to see with platformIO support
https://youtrack.jetbrains.com/issue/CPP-24782

Maybe @ivankravets can have a look at this regarding the things in the bugtracker entry.

1 Like

Hi @blotfi ! Strange, but I cannot reproduce the issue with CLion 2021.1. Are there any non-ascii symbols in the path to your project? Also, could you please try to open the Terminal tab in CLion and run the pio system info command?

image

--------------------------  --------------------------------------------------------
PlatformIO Core             5.1.1
Python                      3.8.0-final.0
System Type                 windows_amd64
Platform                    Windows-10
File System Encoding        utf-8
Locale Encoding             cp1252
PlatformIO Core Directory   C:\Users\my\.platformio
PlatformIO Core Executable  c:\Users\my\.platformio\penv\Scripts\platformio.exe
Python Executable           c:\users\my\.platformio\penv\scripts\python.exe
Global Libraries            0
Development Platforms       2
Tools & Toolchains          11
--------------------------  --------------------------------------------------------

Perhaps should I move to CLion 2021.1 if you say that it works under that
I think also it can be a problem of restriction to Chrome by Windows to access directories? How can I find out?

I am in CLion 2021.1
I launched Chrome with admin rigths
no way

here is a log when trying to add the library
(beware the edition here modify my directory : it is a correct one with \ between my username and .platformio )
Clearly there is a problem of UnicodeDecodeError
but where?

Error: None
Task exception was never retrieved
future: <Task finished name=‘Task-61’ coro=<WebSocketJSONRPCServer._handle_rpc() done, defined at c:\users\my.platformio\penv\lib\site-packages\platformio\commands\home\rpc\server.py:92> exception=UnicodeDecodeError(‘utf-8’, b’Error: [WinError 2] Le fichier sp\xe9cifi\xe9 est introuvable\r\n’, 33, 34, ‘invalid continuation byte’)>
Traceback (most recent call last):
File “c:\users\my.platformio\penv\lib\site-packages\platformio\commands\home\rpc\server.py”, line 96, in handle_rpc
click.secho(“Error: %s” % response.error.data, fg=“red”, err=True)
File "c:\users\my.platformio\penv\lib\site-packages\platformio_main
.py", line 98, in
click.secho = lambda *args, **kwargs: safe_echo(1, *args, **kwargs)
File "c:\users\my.platformio\penv\lib\site-packages\platformio_main
.py", line 91, in _safe_echo
click_echo_origin[origin](*args, **kwargs)
File “c:\users\my.platformio\penv\lib\site-packages\click\termui.py”, line 548, in secho
return echo(message, file=file, nl=nl, err=err, color=color)
File “c:\users\my.platformio\penv\lib\site-packages\click\utils.py”, line 272, in echo
file.write(message)
File “c:\users\my.platformio\penv\lib\site-packages\platformio\commands\home\rpc\handlers\piocore.py”, line 53, in write
value.decode() if is_bytes(value) else value
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xe9 in position 33: invalid continuation byte

Are there any non-ascii symbols in the path to your project or in your username?

no there is no non-ASCII char in my path

My problem is still not solved
I have now an updated version
CLion 2021.3 (nov. 2021)
and PlatformIO Core 5.2.3 Home 3.4.0

it works fine adding library when using VSCode but with CLion it gives these errors related to UTF8, but I have no strange char in my path to the project.
I have french Windows10

thanks

Task exception was never retrieved
future: <Task finished name=‘Task-70’ coro=<WebSocketJSONRPCServer._handle_rpc() done, defined at c:\users\baghli5.platformio\penv\lib\site-packages\platformio\commands\home\rpc\server.py:92> exception=UnicodeDecodeError(‘utf-8’, b’Error: [WinError 2] Le fichier sp\xe9cifi\xe9 est introuvable\r\n’, 33, 34, ‘invalid continuation byte’)>
Traceback (most recent call last):
File “c:\users\baghli5.platformio\penv\lib\site-packages\platformio\commands\home\rpc\server.py”, line 96, in handle_rpc
click.secho(“Error: %s” % response.error.data, fg=“red”, err=True)
File "c:\users\baghli5.platformio\penv\lib\site-packages\platformio_main
.py", line 117, in
click.secho = lambda *args, **kwargs: safe_echo(1, *args, **kwargs)
File "c:\users\baghli5.platformio\penv\lib\site-packages\platformio_main
.py", line 110, in safe_echo
click_echo_origin[origin](*args, **kwargs)
File "c:\users\baghli5.platformio\penv\lib\site-packages\platformio_main
.py", line 117, in
click.secho = lambda *args, **kwargs: safe_echo(1, *args, **kwargs)
File "c:\users\baghli5.platformio\penv\lib\site-packages\platformio_main
.py", line 110, in safe_echo
click_echo_origin[origin](*args, **kwargs)
File "c:\users\baghli5.platformio\penv\lib\site-packages\platformio_main
.py", line 117, in
click.secho = lambda *args, **kwargs: safe_echo(1, *args, **kwargs)
File "c:\users\baghli5.platformio\penv\lib\site-packages\platformio_main
.py", line 110, in safe_echo
click_echo_origin[origin](*args, **kwargs)
File "c:\users\baghli5.platformio\penv\lib\site-packages\platformio_main
.py", line 117, in
click.secho = lambda *args, **kwargs: safe_echo(1, *args, **kwargs)
File "c:\users\baghli5.platformio\penv\lib\site-packages\platformio_main
.py", line 110, in safe_echo
click_echo_origin[origin](*args, **kwargs)
File "c:\users\baghli5.platformio\penv\lib\site-packages\platformio_main
.py", line 117, in
click.secho = lambda *args, **kwargs: safe_echo(1, *args, **kwargs)
File "c:\users\baghli5.platformio\penv\lib\site-packages\platformio_main
.py", line 110, in safe_echo
click_echo_origin[origin](*args, **kwargs)
File "c:\users\baghli5.platformio\penv\lib\site-packages\platformio_main
.py", line 117, in
click.secho = lambda *args, **kwargs: safe_echo(1, *args, **kwargs)
File "c:\users\baghli5.platformio\penv\lib\site-packages\platformio_main
.py", line 110, in safe_echo
click_echo_origin[origin](*args, **kwargs)
File "c:\users\baghli5.platformio\penv\lib\site-packages\platformio_main
.py", line 117, in
click.secho = lambda *args, **kwargs: safe_echo(1, *args, **kwargs)
File "c:\users\baghli5.platformio\penv\lib\site-packages\platformio_main
.py", line 110, in _safe_echo
click_echo_origin[origin](*args, **kwargs)
File “c:\users\baghli5.platformio\penv\lib\site-packages\click\termui.py”, line 548, in secho
return echo(message, file=file, nl=nl, err=err, color=color)
File “c:\users\baghli5.platformio\penv\lib\site-packages\click\utils.py”, line 272, in echo
file.write(message)
File “c:\users\baghli5.platformio\penv\lib\site-packages\platformio\commands\home\rpc\handlers\piocore.py”, line 53, in write
value.decode() if is_bytes(value) else value
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xe9 in position 33: invalid continuation byte

I resolved some problems with encoding issues by activating UTF8 support in Windows (Cyrillic characters in library name causes UnicodeEncodeError · Issue #3971 · platformio/platformio-core · GitHub), which cuases the locale encoding to show up as “cp65001”. Maybe this helps too in this case?

thanks max but it is worse now

Libraries: Could not install library
PIO Core Call Error: “[WinError 2] Le fichier spécifié est introuvable”

adding library doesn’t work because he can’t create files
perhaps I should reinstall platformIO plugin with this new UTF-8 config

What is puzzling me is why VSCode works for both coding and not CLion?

And this is happening on a standard Arduino Uno Blink project (platform-atmelavr/examples/arduino-blink at develop · platformio/platform-atmelavr · GitHub), as the simplest possible project, too? Or only when you add certain libraries?

Does it change anything when you activate Win32 LongPaths and reboot? (Im new and im like a lost puppy - #2 by maxgerhardt)

I use only ESP8266 and ESP32 target (on any library I tried) and I was hitting the same issue of unable to add lib to projects with CLion, whereas with VSCode I add them normally (than I can use CLion to compile, flash, monitor).
If it does not require adding library to the project it works of course directly.
Perhaps that it is the starting of the Web client that is not well done/configured with CLion.
Whereas, it is well started, within VSCode IDE, and succeed in adding new libraries.

Is there any french user of CLion thay has the same issue as me?