Hasura action handler does not exist (Name or service not known)

Hasura action handler does not exist (Name or service not known)


2

I have an instance of Hasura running in the Docker container and action handler API written in NodeJS/Express running directly on the machine.

When I test everything locally it works like a charm ( macOS M1 ), but when I replicate the same setup on the server ( Ubuntu 20.04 ) it returns an action handler does not exist error.

All other queries and mutations work well, just actions return this error

You can see that both Hasura and NodeJS apps are running

hasura docker container

localhost api call

In local development my action handler base url is

https://host.docker.internal:5000/api

and it is working fine.
I have also tried

https://localhost:5000/api

https://127.0.0.1:5000/api

This is the exact error Hasura action call returns

{
"errors": [
    {
        "extensions": {
            "internal": {
                "error": {
                    "type": "http_exception",
                    "message": "ConnectionFailure Network.Socket.getAddrInfo (called with preferred socket type/protocol: AddrInfo {addrFlags = [], addrFamily = AF_UNSPEC, addrSocketType = Stream, addrProtocol = 0, addrAddress = 0.0.0.0:0, addrCanonName = Nothing}, host name: Just "host.docker.internal", service name: Just "5000"): does not exist (Name or service not known)"
                },
                "response": null,
                "request": {
                    "body": {
                        "session_variables": {
                            "x-hasura-role": "public"
                        },
                        "input": {
                            "email": "",
                            "password": ""
                        },
                        "action": {
                            "name": "login"
                        }
                    },
                    "url": "https://host.docker.internal:5000/api/auth/login",
                    "headers": []
                }
            },
            "path": "$",
            "code": "unexpected"
        },
        "message": "http exception when calling webhook"
    }
]

}

2 Answers
2


2

If someone encounters the same issue this is how I solved it

Add this to docker-compose.yml file

    extra_hosts:
    - "host.docker.internal:host-gateway"

Allow ports 8080 and 5000 in firewall

 sudo ufw allow 8080 
 sudo ufw allow 5000


0

I have the same error guys:
except I use node express server locally not docker and hassura cloud for hasura console.

in addition, I use Windows machine



Leave a Reply

Your email address will not be published. Required fields are marked *