[Question] When hitting the import API on localhost:1157/api/monitors/import , it is giving ERROR.
- Dominant language
- Java
- Stars
- 7.4k
- Forks
- 1.3k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 32
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Current Behavior
When hitting the import API on localhost:1157/api/monitors/import , it is giving ERROR.
Also localhost:4200/api/monitors/import gives ERROR.
But when I use to hit "192.163.15.20:4200/api/monitors/import", where 192.163.15.20 is any VM where I am running separate (other) Hertzbeat.
WHY I cant able to hit my localhost API?
### Expected Behavior
When I give localhost in api it should get import. (import of JSON file I am doing)
### Steps To Reproduce
_No response_
### Environment
```markdown
HertzBeat version(s):1.6.1
```
### Debug logs
I have used 1157/api/xxx also but the error I am getting is- I/O error on POST request for "http://localhost:1157/api/monitors/import": Failed to connect to localhost/[0:0:0:0:0:0:0:1]:1157
when I use 4200/api/xxx- 504 Gateway Timeout: "Error occurred while trying to proxy: localhost:4200/api/monitors/import"
### Anything else?
_No response_
Contributor guide
Research direction
Start by reproducing the POST request to /api/monitors/import against localhost:1157 and localhost:4200 using the reported HertzBeat 1.6.1 environment, then compare it with the VM address that works. Inspect the reported connection-refused and proxy-timeout messages and the API or proxy configuration; done means JSON import succeeds through the localhost endpoint.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100