Hi Prefect experts, anyone can help with this ?
# prefect-community
a
Hi Prefect experts, anyone can help with this ?
z
Hi, you’ll have to provide some more details on your setup
a
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
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
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
Can you run
prefect diagnostics
?
a
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
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
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
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
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
So if you can’t connect to the graphql page it’s definitely an issue with the apollo server, not the UI
a
okay, how can i move forward
any suggestions ? please note am new to Prefect and apollo server
@Zanie ^^
z
And what’s the output of
docker logs <apollo-container-id>
a
@Zanie fyi
z
And visiting http://localhost:4200/graphql from the machine that you’re looking at the docker logs from is not working?
a
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
Okay so this machine is not your local machine. This seems really likely to be a networking issue
a
hmmm.... I cannot figure-out what it is, .. @Zanie you don't see any issues from apollo docker logs, right?
z
Apollo seems to be hosting quite happily
And the docker ps you showed indicate that it is forwarding ports correctly
a
mmmm... then not sure whats blocking in between
yeah..
z
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
Yes, Understand , thanks , I think the problem lies only with that 4200 port.. cos, I can access prefect home page
z
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
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
It’s past everyone’s workdays here
a
oh..
z
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
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