18 comments
Comment actions Permalink

Please provide the detailed problem description (what do your environment file and HTTP request look like, what errors can you see namely, etc)

0
Comment actions Permalink

HI,

 

I've the same issue. In the past the editor worked well for me. 

It's looking like this:

I'm using:

IntelliJ IDEA 2020.1.2 (Ultimate Edition)
Build #IU-201.7846.76, built on June 1, 2020
Licensed to xxx
Subscription is active until November 2, 2020
Runtime version: 11.0.7+10-b765.53 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 10.15.5
GC: ParNew, ConcurrentMarkSweep
Memory: 1979M
Cores: 12
Non-Bundled Plugins: com.intellij.plugins.watcher, com.jetbrains.php, intellij.prettierJS, org.asciidoctor.intellij.asciidoc

 

But I've multiple variables configured:

 

In the last week I removed / disabled many plugins (but for sure not the "Http Client"). Not sure if it's related to the issue.

 

best regards

Matthias

1
Comment actions Permalink

Hey there, i am having the same issue.

I've been using http client request files for quite some time now in a certain project where i've been testing all API end points with them. I have added new variables before and it worked completely fine.
I wanted to add a new variable "refreshToken", but since i changed that variable (might be coincidence in timing), phpstorm won't read http environment var files anymore.

I have my request files in sub folders in the folder 'api-requests'. That folder contains the environment files.
$ ls -tR api-requests/

api-requests/:
auth cards me crash-report transactions accounts http-client.env.json http-client.private.env.json.dist http-client.env.json.dist http-client.private.env.json

api-requests/auth:
set-new-password.http forgot-password.http logout.http login.http login-fails.http refresh-token-fails.http refresh-token.http

etc...


If i click the button "Add Environment File" on top of the editor, a new file will be added directly in the sub directory where the request file is in. When i set up an environment with variables there now (just for testing purposes), they are also not read. 

This issue started appearing last week.
After that I even updated phpstorm (was using 2020.1, updated to 2020.2) but that sadly didnt solve the issue

 

There might be some invalid cache which causes the problem, but i have yet to find it.

Any help would be appreciated, I really liked not having to use postman! :)

 

PhpStorm 2020.2.2
Build #PS-202.7319.77, built on September 23, 2020
Licensed to XXX
Subscription is active until October 7, 2020
Runtime version: 11.0.8+10-b944.31 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 5.7.7-100.fc31.x86_64
GC: ParNew, ConcurrentMarkSweep
Memory: 926M
Cores: 8
Registry: run.processes.with.pty=TRUE, debugger.watches.in.variables=false
Non-Bundled Plugins: Key Promoter X, String Manipulation, YAML/Ansible support, codes.rudolph.idea.cfg, com.intellij.ideolog, io.github.qeesung.component.HighlightBracketPair, name.kropp.intellij.makefile, de.espend.idea.php.phpunit, net.king2500.plugins.PhpAdvancedAutoComplete, de.espend.idea.php.toolbox, de.espend.idea.php.annotation, fr.adrienbrault.idea.symfony2plugin
Current Desktop: KDE

0
Comment actions Permalink

Works here, on 2020.2.2. Please check if the same problem happens in a brand new project. If it reoccurs - please share more data or examples of your requests

0
Comment actions Permalink

Try restarting your IDE after setting up the environment file.

It worked for me on Windows with a brand new project.

0
Comment actions Permalink

Broken for me as well as at 2020.2.2 and 2020.2.3.

I have a long-running project with an established `http-client.private.env.json` file in it that has worked fine for ages, but now it fails to load the environments when I go to run the commands.

My set-up is pretty simple — a single directory with a few .http files and a single *env.json file. The directory is not excluded. I'm on latest MacOS.

I've tried:

  1. Restarting the IDE
  2. Deleting and recreating the http-client.private.env.json file and restarting the IDE
  3. Using a http-client.env.json file instead (and restarting the IDE)
  4. Invalidate caches and restart

Seems broken to me. Any ideas?

Update: seems to work now for me. I can't make it break now and unfortunately I don't know what I did to fix it, so I don't know conclusively what it was. It will remain a mystery. 

0
Comment actions Permalink

Scott Davey you can send us your IDE logs archive (Help > Collect Logs and Diagnostic Data) via Help | Contact Support or via https://uploads.jetbrains.com/. We'll check if there are any HTTP client related errors.

0
Comment actions Permalink

Dimitry, I've uploaded 2020_10_19_RP6pPUb6HFimewH1 for you. 

0
Comment actions Permalink

Thanks! Unfortunately the logs didn't provide any insights on the problem.

I've submitted this as https://youtrack.jetbrains.com/issue/IDEA-253417 for a corresponding team to further look into.

0
Comment actions Permalink

Hi, I added a comment to https://youtrack.jetbrains.com/issue/IDEA-253417  which might be a cause.

0
Comment actions Permalink

I'm having the same issue with 2021.1 EAP 3. As you can see all files are in correct place.

0
Comment actions Permalink

The original problem is still not addressed, only 2 votes so far. It would help if you vote for it & leave your comments there.

0
Comment actions Permalink

I've also got this problem in recent versions of IDE (IntelliJ IDEA 2021.1 and PyCharm 2021.1).
All of a sudden my requests that I used just a few days ago stopped working.
HTTP client fails with the "Invalid URI because of unsubstituted variable 'host'" message and neither of 3 suggested options works:

  1. "Add new environment file" doesn't let me to add "Regular" file, because it's already exists.
  2. "Add Variable To Existing Environment" doesn't work because there is "No configured environments".
  3. And "Run with environment" doesn't work because "There are no environments with variable 'host'".

The only workaround I found is to move the existing environment file to some other location, create a new environment file and copy the environment file content to the new file.

2
Comment actions Permalink

I got a similar issue and it turns out I had a hidden character in my `http-client.env.json` file name. 

it was quite annoying to debug

1
Comment actions Permalink

Hello,
same issue here.

- JetBrains Rider 2021.3.3

- MAC OS


As the screenshot shows I can't add a http-client.env.json because it is there and, in this case, it contains the unsubstituted variable.
Nor is it found in the Env configuration (default: No Environment).

I would be really nice to get it fixed.

Everything works without unsubstituted variable

0
Comment actions Permalink

Same problem, using IntelliJ IDEA 2021.3.3 (Ultimate Edition) and macOS 11.6.5.

I have .http file located outside of project directory, http-client.env.json and http-client.private.env.json were automatically generated next to it. But when I open it with IntelliJ the environment is ignored. I move all files into project root directory and then it started to work. 

0
Comment actions Permalink

Same here.

I have three *.http files in the same directory. (Let say foo.http and bar.http)

Two of them work as expected the third one does not.

---------

foo.http

GET https://{{url_host}}/{{url_path_prefix}}/foo

---------

bar.http

GET https://{{url_host}}/{{url_path_prefix}}/bar

---------

I could provide the same screenshot.

Error message: Invalid URI because of unsubstituted variable

However the variable autocomplete always works as expected after {{.

 

 

PhpStorm 2022.1 EAP
Build #PS-221.5080.66, built on March 24, 2022
Runtime version: 11.0.14.1+1-b2043.17 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 5.16.14-1-default

0
Comment actions Permalink

I was facing the same issue using WebStorm. The problem in my case was that the "Run Configuration" was missing the environment, even tho it was selected in the http request tab.

It is quite simple to reproduce it. Just create an empty project and a new HTTP client request with a variable.

When I tried to run the request in context, it failed because of a missing variable.

Here the generated configuration missing the environment.

However, once I ran it using the "Run All Requests in File" option, it worked.

And the previous generated configuration had the environment set, allowing me to run the request in context without any issue.

--

WebStorm 2022.1
Build #WS-221.5080.193, built on April 10, 2022
Runtime version: 11.0.14.1+1-b2043.25 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 12.4

0

Please sign in to leave a comment.