appsmithorg / appsmith

Platform to build admin panels, internal tools, and dashboards. Integrates with 25+ databases and any API.
https://www.appsmith.com
Apache License 2.0
33.91k stars 3.66k forks source link

[Bug]: Api call returns Execution failed with status 5000 Unknown host. #14754

Closed alanPaivaAsp closed 1 year ago

alanPaivaAsp commented 2 years ago

Is there an existing issue for this?

Description

I just downloaded the docker-compose file, listed in this tutorial https://docs.appsmith.com/setup/docker, then after docker-compose up everything seems just fine (after changing exposed port to 8081): image

However, when I try to do a simple API request, it simply returns an error:

Execution failed with status 5000
Unknown host.
{
"headers":[...]
"httpMethod":"GET"
"url":"https://api.themoviedb.org/3/discover/movie?api_key=19f39f3c484954b02ac387996570be32"
}

image

I'd tried to add the host by hand, as the error said unknow host, but no changes. If you hit the api using the appsmith web page application (or even directly in the browser) it works: image

Here is the docker-compose file I used:

version: "3"

services:
  appsmith:
    image: index.docker.io/appsmith/appsmith-ce
    container_name: appsmith
    ports:
      - "8081:80"
      - "443:443"
    volumes:
      - ./stacks:/appsmith-stacks
    restart: unless-stopped

  #   # Uncomment the lines below to enable auto-update
    labels:
      com.centurylinklabs.watchtower.enable: "true"

  auto_update:
    image: containrrr/watchtower:latest-dev
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    # Update check interval in seconds.
    command: --schedule "0 0 * ? * *" --label-enable --cleanup
    restart: unless-stopped

Steps To Reproduce

  1. Download the docker-compose.yml file from https://docs.appsmith.com/setup/docker
  2. Run docker-compose up
  3. Go to localhost:80 (or the port you defined)
  4. Create new accont
  5. Go to Queries/JS session > + > New Blank API: image
  6. Hit run button: image

Errors I got:

06:14:59 [Api2] Execution failed with status 5000
Unknown host.
{
"headers":[
]
"httpMethod":"GET"
"url":"https://api.themoviedb.org/3/discover/movie?api_key=19f39f3c484954b02ac387996570be32"
}

06:13:23 [Api2] Execution failed
{}
{
"headers":[
]
"body":{
}
"httpMethod":""
"url":""
}

06:03:46
[Api1] Execution failed with status 5000 
Unknown host.
{
"headers":[
0:{
"host":"api.themoviedb.org"
}
]
"httpMethod":"GET"
"url":"https://api.themoviedb.org/3/discover/movie?api_key=19f39f3c484954b02ac387996570be32"
}

image

Public Sample App

No response

Version

Self Hosted - Latest version

Nikhil-Nandagopal commented 2 years ago

@sharat87 @pratapaprasanna is this because the host is re-mapped?

sharat87 commented 2 years ago

@Nikhil-Nandagopal, changing the port shouldn't make a difference here.

@alanPaivaAsp, this is very strange from the looks of it. Can you share the log file at stacks/logs/backend/*.log to help troubleshoot this issue please? Thank you!

davinder-singh7 commented 1 year ago

Is it resolved?

shossur commented 1 year ago

Any solution for this issue, i am also facing the same issue

Nikhil-Nandagopal commented 1 year ago

@shossur @davinder-singh7 we're not able to reproduce this issue. Can you please share an application with us where this issue occurs?

arshad10244 commented 1 year ago

I had a similar issue but it was caused by container not being able to resolve the hostname. I'd suggest running a ping and wget from within the container to see if it is able to resolve and fetch the response

chriscervantes commented 1 year ago

is this resolve? I am still getting this issue i am using 1.9.31 version.