Open Excel file from Services pane
I have an HTTP Request where I save response to a file:
### Download
GET {{url}}
>>! /home/alvaro/files/{{filename}}
The Services panel generates a link. When I click on it for the first time, I get a prompt asking if I want to edit files outside project. I say "yeah, sure", but nothing else ever happens. I'd expect to have it opened in the default program (namely LibreOffice Calc).
I'm using PhpStorm 2022.3 from Snap release on KDE Plasma (Ubuntu 22.04 LTS) and my system has a few glitches, so I'm unsure about where the problem may be.
Please sign in to leave a comment.
Could not reproduce that on PhpStorm 2022.3 + Windows 11, files can be opened easily.
Basically, the built-in HTTP client saves response files in the project ".idea/httpRequests" directory. Do you have anything downloaded there? Is it possible to open files from this directory apart from the IDE?
I have full access to .idea/httpRequests and, indeed, I get responses saved there. When I use >>! to save a file into another location the file is saved in that location rather than .idea. That part is fine: the path reported is fully correct and I can open the file by copying and pasting it anywhere else (e.g. KRunner).
I get this dialogue in PhpStorm:
I grant permission, but that's as far as I get.
What isn't working is the feature to launch non-supported file types in the associated program, because everything works fine if I append ".txt" to the file name (PhpStorm displays binary data in a tab). Nothing gets printed to "idea.log", not sure where else to look.
Today it's just working normally...
I don't understand computers any more... 😭
Wow, this is surprising in a good way!
Do you recall any recent changes or just a simple OS restart that took place last days?
I don't know. I have to restart the system everyday because neither suspend nor hibernation work with my hardware, and Ubuntu has daily updates.
And it's broken again...
I'm finding these entries in /var/log/syslog, I don't know if they're any useful:
Could you please try a simple test?
Navigate to "File | Settings | Editor | File Types > Files opened in associated application", add any random extension like "*.aaa" to the list of patterns, create "test.aaa" file in your project and try to open it with the PhpStorm. What would it show?
If I create test.aaa inside my project, I can use it as any other file. It opens normally from Project pane, file search...
I've also tested all combinations in HTTP requests: extensions (aaaa, xlsx and txt) and locations (inside/outside project). Result is that txt links always open and aaaa and xlsx never do.
Sorry if this post is duplicated, everything was seemingly lost when I clicked "Submit".
Sorry, I might be missing this part. Does the 'test.aaa' open normally in an external application (= OS file explorer), right?
"If I create test.aaa inside my project, I can use it as any other file. It opens normally from Project pane, file search..."
Arrr, sorry, I think I messed this. I've tried again (with a different extension, to be sure):
Nothing at all happens when I create a file in the project and try to open it.
Thanks!
I have tried to reproduce the issue on another machine (with Linux this time) but it works fine there as well.
Have you checked the IDE log file (Help > Show Logs) after the unsuccessful attempt of 'test.aaa' opening? Is there anything similar to "File is not open" error?
What I would like to suggest is to enable the extended logging, try to open the 'test.aaa' file again and collect & share log files, so I could take a closer look.
To increase the log level, please add the following line to "Help > Debug Log Settings":
#com.intellij.execution
Afterwards, logs can be collected with the "Help > Collect Logs" menu option. You may use JetBrains Upload service to upload logs:
https://uploads.jetbrains.com/
Done:
Upload id: 2023_01_09_wYKij6sTTvAUUpuYhLNtcg (file: phpstorm-logs-20230109-154130134234552925724356.zip)
I don't get any entry in idea.log when I click on the link and nothing happens.
Sorry for the delay, I left for Xmas holidays and then forgot about this.
Sorry for the delayed response, missed your comment.
Thank you for sharing the log files pack. Sadly, I was not able to find anything suspicions there (apart from the old "file is not open") :(
Could you please try another test?
The idea is simple -- just try to open one of these .xls files from a terminal (both from IDE and OS) with the "xdg-open" command, like:
xdg-open <absolute path to .xls file>
Does it work?
In IDE console, nothing happens.
In KDE Konsole, I see this but the file opens in LibreOffice Calc:
Thanks for checking.
Sadly, I am still unable to reproduce the issue, I even tried a different Ubuntu installation. I wonder why a simple 'xdg-open' does not output anything from IDE terminal though. Is it possible to share the full "env" output both from OS and IDE terminal?
You may use the same upload services above to share output files.
There you are: Upload id: 2023_01_26_tfWZBh9K1s2n4q4QbCEeto (files: env.phpstorm, env.konsole)
Thanks!
I cannot get rid of an idea that it could be related to the fact that PhpStorm is installed & launched from Snap.
Would it be a big effort for you to download and launch a standalone PhpStorm 2022.3.1 installation and try all these tests (open XLSX file directly, "xdg-open" from terminal, open custom extension file) on a standalone build?
Just in case, a download link:
https://www.jetbrains.com/phpstorm/download/#section=linux
Sorry, I didn't need to work with downloaded files for some time, and I hadn't anticipated that it'd be so easy to test.
This is totally a Snap release problem. In downloaded tar.gz file everything works.
On a side note, what does the "classic" flag in
sudo snap install phpstorm --classic
do? I can't remember if I added when I first installed.Edit #1: Ah...
--classic
Put snap in classic mode and disable security confinement
Let me test something...
Edit #2: I reinstalled Snap release, ensuring I used the classic flag. It wasn't that. If I want to click on file links, I have to use tar.gz release. Any chance to see an official Ubuntu repo? 😉
Not yet planned, but here's the feature request: https://youtrack.jetbrains.com/issue/IDEA-22750/Debian-package-build-script-provided
Someone in that ticket says:
Is that correct? Can I use Toolbox to have PhpStorm updated and get a non-snap release that doesn't exhibit this bug?
You definitely can: https://www.jetbrains.com/toolbox-app/
Please note that you can keep the tar.gz installation updated as well - the IDE checks for updates automatically and then when there's one, shows a dot on the gear icon in the main toolbar; you can click the icon and choose the
Update
action which will patch the installation to the newer version.