https://prefect.io logo
a

Ajith Kumara Beragala Acharige Lal

12/28/2020, 5:17 PM
Hi Prefect experts, anyone can help with this ?
z

Zanie

12/28/2020, 5:18 PM
Hi, you’ll have to provide some more details on your setup
a

Ajith Kumara Beragala Acharige Lal

12/28/2020, 5:19 PM
Thanks @Zanie, I've already provided some information in the previous thread, can you help me to know whats missing , so that I can provide them?
z

Zanie

12/28/2020, 5:19 PM
I’ll take a look at that!
🙏 1
I’m a little confused about what your current config is
Can you show the output of
prefect diagnostics
a

Ajith Kumara Beragala Acharige Lal

12/28/2020, 5:25 PM
latest
config.toml
tried in
~/.prefect
as below
Copy code
# debug mode
debug = true

# base configuration directory (typically you won't change this!)
home_dir = "~/.prefect"

backend = "server"

[server]
host = "<http://localhost>"
port = "4200"
host_port = "4200"
endpoint = "${server.host}:${server.port}"

    [server.database]
    host = "10.110.0.7"
    port = "5433"
    host_port = "5433"
    name = "prefect_server"
    username = "prefect"
    # set to "" to generate a random password each time the database starts
    password = "test-password"
    connection_url = "postgresql://${server.database.username}:${server.database.password}@${server.database.host}:${server.database.port}/${server.database.name}"
    volume_path = "${home_dir}/pg_data"

    [server.ui]
    host = "<http://localhost>"
    port = "8089"
    host_port = "8089"
    endpoint = "${server.ui.host}:${server.ui.port}"
    apollo_url = "<http://localhost:4200/graphql>"


[logging]
# The logging level: NOTSET, DEBUG, INFO, WARNING, ERROR, or CRITICAL
level = "DEBUG"
@Zanie ^^
z

Zanie

12/28/2020, 5:27 PM
Can you run
prefect diagnostics
?
a

Ajith Kumara Beragala Acharige Lal

12/28/2020, 5:27 PM
sure.. 2 minutes
@Zanie thanks , here is the output
Two errors
Copy code
hasura_1    | {"type":"pg-client","timestamp":"2020-12-28T17:34:54.107+0000","level":"warn","detail":{"message":"postgres connection failed, retrying(1)."}}
hasura_1    | {"type":"startup","timestamp":"2020-12-28T17:34:54.107+0000","level":"error","detail":{"kind":"db_migrate","info":{"internal":"server closed the connection unexpectedly\n\tThis probably means the server terminated abnormally\n\tbefore or while processing the request.\n","path":"$","error":"connection error","code":"postgres-error"}}}
Copy code
graphql_1   | Error: HTTPConnectionPool(host='hasura', port=3000): Max retries exceeded with url: /v1/query (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f9de56206d0>: Failed to establish a new connection: [Errno 111] Connection refused'))
okay, I changed below
Copy code
[server.hasura]
    host = "10.110.0.7"
@Zanie no more errors noticed , but still cannot connect
<http://10.110.0.7:4200/graphql>
@Zanie let me know if you have any suggestions , thank you in a*d*vance!
z

Zanie

12/28/2020, 6:42 PM
Can you please run
prefect diagnostics
e.g.
Copy code
❯ prefect diagnostics
{
  "config_overrides": {
    "cloud": {
      "agent": {
        "auth_token": true,
        "level": true
      },
      "auth_token": true
    },
    "engine": {
      "executor": {
        "default_class": true
      }
    }, 
    ...
Did you post the wrong screenshot earlier?
Why are you changing the host from localhost to 10.110.0.7? Are you hosting Prefect Server on a separate machine from the one you are using to try to access the UI?
a

Ajith Kumara Beragala Acharige Lal

12/29/2020, 1:25 AM
Thanks for response @Zanie, the
localhost
= local_ip (
10.110.0.7
) , I was trying both
localhost
and the
local ip
to see if one of them unblocks me
the output of
prefect diagnostics
as below
Copy code
{
  "config_overrides": {
    "backend": true,
    "debug": true,
    "server": {
      "database": {
        "host": true,
        "host_port": true,
        "port": true
      },
      "diagnostics": true,
      "graphql": {
        "debug": true
      },
      "hasura": {
        "host": true
      },
      "ui": {
        "apollo_url": true,
        "host_port": true,
        "port": true
      }
    }
  },
  "env_vars": [],
  "system_information": {
    "platform": "Linux-4.15.0-124-generic-x86_64-with-Ubuntu-18.04-bionic",
    "prefect_backend": "server",
    "prefect_version": "0.14.0",
    "python_version": "3.6.9"
  }
}
z

Zanie

12/29/2020, 1:33 AM
Can you access the graphql server at
<http://localhost:4200/graphql>
or http://10.110.0.7:4200/graphql by entering it into your browser?
Also, can you successfully start the server with no changes from the default config file?
a

Ajith Kumara Beragala Acharige Lal

12/29/2020, 1:35 AM
Thanks for responding @Zanie, I cannot start without config changes as Airflow and another Postgres running on same machine..
our company wants to migrate to Prefect ( instead Airflow)
am doing the POC
the browser cannot connect to
<http://10.110.0.7:4200/graphql>
but could connect
<http://10.110.0.7:8089/home>
@Zanie ^^
z

Zanie

12/29/2020, 1:40 AM
So if you can’t connect to the graphql page it’s definitely an issue with the apollo server, not the UI
a

Ajith Kumara Beragala Acharige Lal

12/29/2020, 1:40 AM
okay, how can i move forward
any suggestions ? please note am new to Prefect and apollo server
@Zanie ^^
z

Zanie

12/29/2020, 1:44 AM
And what’s the output of
docker logs <apollo-container-id>
a

Ajith Kumara Beragala Acharige Lal

12/29/2020, 1:45 AM
@Zanie fyi
z

Zanie

12/29/2020, 1:48 AM
And visiting http://localhost:4200/graphql from the machine that you’re looking at the docker logs from is not working?
a

Ajith Kumara Beragala Acharige Lal

12/29/2020, 1:50 AM
Hi @Zanie, Please note I've VPN connected to our DEV , that machine's IP is
10.110.0.7
Yes, it's not working for both
<http://localhost:4200/graphql>
and http://10.110.0.7:4200/graphql
z

Zanie

12/29/2020, 1:51 AM
Okay so this machine is not your local machine. This seems really likely to be a networking issue
a

Ajith Kumara Beragala Acharige Lal

12/29/2020, 1:52 AM
hmmm.... I cannot figure-out what it is, .. @Zanie you don't see any issues from apollo docker logs, right?
z

Zanie

12/29/2020, 1:52 AM
Apollo seems to be hosting quite happily
And the docker ps you showed indicate that it is forwarding ports correctly
a

Ajith Kumara Beragala Acharige Lal

12/29/2020, 1:52 AM
mmmm... then not sure whats blocking in between
yeah..
z

Zanie

12/29/2020, 1:53 AM
It’s important to note that the user of the browser that is accessing the UI needs access to the API (graphql) route
So if I host the UI and API on a server behind a firewall
And I make a hole for myself to access the UI, it won’t work
The UI/API are on the same machine but the user’s browser makes requests directly to the API.
a

Ajith Kumara Beragala Acharige Lal

12/29/2020, 1:54 AM
Yes, Understand , thanks , I think the problem lies only with that 4200 port.. cos, I can access prefect home page
z

Zanie

12/29/2020, 1:54 AM
You could try changing it to something in the 808x range
but yeah the logs look fine so I’m not sure what’s stopping you from accessing it
a

Ajith Kumara Beragala Acharige Lal

12/29/2020, 1:55 AM
ahaa... okay.. that's good idea
thanks.. @Zanie if you are about to go offline , please let me know someone I can continue this chat with ... cos this tasks deadline is almost over
i'll try changing the port
z

Zanie

12/29/2020, 1:56 AM
It’s past everyone’s workdays here
a

Ajith Kumara Beragala Acharige Lal

12/29/2020, 1:58 AM
oh..
z

Zanie

12/29/2020, 1:58 AM
I’ve shared it with the rest of the team, but I don’t think anyone will have any suggestions beyond what I’ve said — it seems likely it has to do with your specific infrastructure
a

Ajith Kumara Beragala Acharige Lal

12/29/2020, 2:01 AM
hmm.. let me check with out DEV-OPS
thanks a lot @Zanie
@Zanie wooo hooo.... yay..
it worked
I used port 8081 instead of 4200
🙏🎉🎄🕺... many thanks @Zanie