mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-25 16:55:59 +03:00
[GH-ISSUE #3435] [bug]: Self-Hosted AIO - POST http://localhost:3170/graphql net::ERR_CONNECTION_REFUSED #1160
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#1160
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @owlpro on GitHub (Oct 8, 2023).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/3435
Is there an existing issue for this?
Current behavior
hi, after setup AIO with docker from hoppscotch/hoppscotch:2023.8.1
(https://hub.docker.com/layers/hoppscotch/hoppscotch/2023.8.1/images/sha256-8c4ea4157035f6ae5ac58d36d82e423287ec815f54c1350d00dde7f03236a112?context=explore)
i got this error

when i refresh from cache (Ctrl + Shift + R) there is no problem
but when i simple refresh (Ctrl + R) get this error
Cache Refresh

import_meta_envvariable values:Simple Refresh

import_meta_envvariable values:Steps to reproduce
reproduce with docker:
Environment
Production
Version
Self-hosted
@owlpro commented on GitHub (Oct 9, 2023):
Is there a quick fix?
For example, a change in Docker or whatever
@icsy7867 commented on GitHub (Nov 7, 2023):
I am getting this as well. When I click the magic link, the console is showing attempts made to localhost:3170, instead of my set domain-name.com:3170
However the main site loads just fine.
@icsy7867 commented on GitHub (Nov 7, 2023):
I went ahead and converted to the three separate containers:
hoppscotch-frontend
hoppscotch-backend
hoppscotch-admin
And I am getting the same errors. After successfully receiving the magic links and clicking them the console is showing all "localhost" URLS, instead of the URLS I have set in the .env file.
A hard cache reload fixes this, until I try to log in again, and then those variables are saved in my session.
@jaydip-appvolution commented on GitHub (Jan 3, 2024):
I am using the AIO container of Hoppscotch and getting the same error while hosting on a domain.
Replace all localhost URLs to domain URLs but didn't get success.
Can someone help me to fix this?
@owlpro commented on GitHub (Jan 4, 2024):
use this docker-compose.yml to fix:
@danztohamaerp commented on GitHub (Sep 2, 2024):
so what's the fix? I'm having the same issue :(
@aryaag commented on GitHub (Sep 12, 2024):
@owlpro - Could you explain what the fix is?
@owlpro commented on GitHub (Sep 12, 2024):
I don't know exactly
I was just looking for a way to use it
This problem is in the AIO container, and if it is Using individual containers for the services, this problem does not exist
docker-compose.yml
@aryaag commented on GitHub (Sep 13, 2024):
In the end, what fixed it was moving away from AIO and path based routing. See more here.
@bobafettfrom commented on GitHub (Nov 11, 2024):
Hi! Finally, can someone show a working config file (env) when I want to use my own domain name instead of localhost? for example when hoppscotch is behind nginx or another reverse proxy
@samaphp commented on GitHub (Nov 24, 2024):
This project is incredibly promising. I'm not sure why the docker compose file has decided to go for the "twice is nice" approach with duplicated services. it’s a bit confusing and frustrating to debug just for a hands on demo.
I'm still trying to solve this puzzle, It seems you should use the happy scenario in order to make it work and avoid change the localhost or the external ports.
Thank you to all the contributors for the hard work in building such a useful dev tool!
@conquista41 commented on GitHub (Jan 3, 2025):
any updates about using own domain behind a reverse proxy? @bobafettfrom
@brecht-vermeersch commented on GitHub (Mar 20, 2025):
Works for me with this env
/graphql becomes /backend/graphql
@MadWalnut commented on GitHub (Apr 16, 2025):
I also have to hard reload (Ctrl+F5) almost every time I open Hoppscotch. Without doing that all my environments and workspaces are gone. This seems to be an issue with the AIO-container,
ENABLE_SUBPATH_BASED_ACCESS=trueand a reverse proxy with a domain (in my case Caddy with TLS forhttps://hoppscotch.domain.com).@CuriousCorrelation sorry for the direct ping, but would you mind taking a look at this? Can we provide any more information to help? Thank you very much!
For reference, this is my setup:
@CuriousCorrelation commented on GitHub (Apr 16, 2025):
Hi @MadWalnut, thanks for the config details. While I don't have the full context at the moment, this appears similar to a known issue with service workers caching environment variables in some deployments. If that's the case, clearing the workbox cache might help:
In DevTools ->
Applicationtab (Chrome/Edge/Brave) orStoragetab (Firefox) ->Cache Storage-> Your domain ->workbox-precache-v*-> Delete/Clear (option varies by browser)After clearing, refresh the page and it should load with the correct environment variables.
@MadWalnut commented on GitHub (Apr 17, 2025):
@CuriousCorrelation Thank you for your reply! That does indeed fix the issue. Ctrl+F5 works as well.
Can we help by providing more information to fix the underlying issue? Or perhaps test some potential fixes?
I would love to switch my company over to Hoppscotch from Postman, but explaining to my colleagues to Ctrl+F5 multiple times per day is a non starter :D
@CuriousCorrelation commented on GitHub (Apr 17, 2025):
@MadWalnut Thanks for the confirmation.
If clearing
workbox-precache-v*works, you shouldn't need to useCtrl + F5anymore. The app should load with the correct environment variables after that. This should be a one-time fix per browser, similar to opening the instance in a private session.I imagine the reason for it is the cache (for offline support/PWA) built with prior environment variables not invalidating itself with new deployment variables. The reasons could be related to how environment variables are injected at runtime (vs build time).
Although that is just an educated guess at the moment because I’ve encountered similar issue when writing the new desktop app which is why the desktop differentiates between deployments via a hash, you can read more about that here https://github.com/hoppscotch/hoppscotch/issues/4891
We're tracking this caching behavior issue internally, in the meantime if using the Hoppsctoch Desktop app is a possibility in your environment, I think it might provide an immediate solution without any workarounds for your usecase. The desktop app has some advantages over the browser version due to its very nature, being closer to the platform, and could unblock your adoption initiative.
@MadWalnut commented on GitHub (Apr 17, 2025):
@CuriousCorrelation Thank you for your detailed response. That is great news! I have indeed not encountered another problem since clearing
workbox-precache-v*yesterday. Great to hear you continue to monitor this though. Keep up the great work with Hoppscotch!