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

Could not resolve config path #10418

Closed
M393 opened this issue Nov 28, 2023 · 12 comments · Fixed by #10442
Closed

Could not resolve config path #10418

M393 opened this issue Nov 28, 2023 · 12 comments · Fixed by #10442

Comments

@M393
Copy link

M393 commented Nov 28, 2023

On Windows 10 after upgrading from 5.15.0 to 5.16.0 I get this error:

[INFO - 10:52:14 AM] Starting language server
[INFO - 10:52:14 AM] Psalm Version was detected as 5.16.0
[ERROR - 10:52:15 AM] Problem parsing C:\test\psalm.xml:
Could not resolve config path to C:\test\C:\test

C:\test is the project location, seems like the path is concatenated to itself.

Tried to remove everything from my config file, still same error:

<?xml version="1.0"?>
<psalm
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="https://getpsalm.org/schema/config"
    xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
>
</psalm>
Copy link

Hey @M393, can you reproduce the issue on https://psalm.dev ?

@kkmuffme
Copy link
Contributor

kkmuffme commented Dec 1, 2023

What's the exact psalm command you run?

@M393
Copy link
Author

M393 commented Dec 1, 2023

I'm using the vscode extension (v2.7.0). The log above is from the Output panel.

@M393
Copy link
Author

M393 commented Dec 1, 2023

Here is a simplified command of what the VSCode extension is running:

php.EXE -f c:\test\vendor\vimeo\psalm\psalm-language-server -- -c c:\test\psalm.xml -r c:\test --tcp=127.0.0.1:60536

Output:

Problem parsing C:\test\psalm.xml:
Could not resolve config path to C:\test\C:\test

kkmuffme added a commit to kkmuffme/psalm that referenced this issue Dec 2, 2023
@kkmuffme
Copy link
Contributor

kkmuffme commented Dec 2, 2023

Will be fixed with my PR on the next release :-)

@theodorejb
Copy link
Contributor

I'm seeing this error notification pop up with Psalm 5.17 every time I open any PHP file in PhpStorm. For example:

psalm: Problem parsing C:\Users\TheodoreBrown\Documents\code\main\psalm.xml:
Could not resolve config path to C:\Users\TheodoreBrown\Documents\code\main\C:\Users\TheodoreBrown\AppData\Local\Temp\Psalmtemp_folder1276\php\utilities\Page.php

@M393
Copy link
Author

M393 commented Dec 5, 2023

I updated to 5.17 just now and no longer have this issue.

Try to find out how with which parameters psalm is started. Install the last working version and get the command line arguments:
https://superuser.com/a/981599

@theodorejb
Copy link
Contributor

The error occurs with both 5.16 and 5.17, but not with 5.15. According to Process Monitor the following command is being run:

C:\Windows\system32\cmd.exe /c C:\Users\TheodoreBrown\Documents\code\main\vendor\bin\psalm.bat --output-format=checkstyle -c C:/Users/TheodoreBrown/Documents/code/main/psalm.xml --monochrome C:/Users/TheodoreBrown/AppData/Local/Temp/Psalmtemp_folder2266/php/utilities/Page.php

@kkmuffme
Copy link
Contributor

kkmuffme commented Dec 6, 2023

@theodorejb could you try to run the command with windows directory separators in the file path, e.g. C:\Users\TheodoreBrown\AppData\Local\Temp\Psalmtemp_folder2266\php\utilities\Page.php instead of C:/Users/TheodoreBrown/AppData/Local/Temp/Psalmtemp_folder2266/php/utilities/Page.php

Do you still get this error then?

It seems like the issue is in something that was supposed to be fixed by another PR here #10441 but perhaps this function has an issue when unix separators are used on windows?

@theodorejb
Copy link
Contributor

@kkmuffme I get the same error for both forward slash and backslash directory separators.

@theodorejb
Copy link
Contributor

I found the issue and opened #10452 to fix it.

@kkmuffme
Copy link
Contributor

kkmuffme commented Dec 6, 2023

Yeah, it's kind of what I expected already #10441 (comment)

theodorejb added a commit to theodorejb/psalm that referenced this issue Dec 6, 2023
These were missed in vimeo#10441. Fixes "Could not resolve config path" error on Windows (vimeo#10418).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants