Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI cannot connect to Prefect Server hosted on Ubuntu VM #212

Closed
marvin-robot opened this issue Mar 11, 2021 · 6 comments
Closed

UI cannot connect to Prefect Server hosted on Ubuntu VM #212

marvin-robot opened this issue Mar 11, 2021 · 6 comments

Comments

@marvin-robot
Copy link
Member

Opened from the Prefect Public Slack Community

info973: Hey guys, one question... I experienced this on multiple systems, usually all ubuntu server lts 20.04, installing with pip.
On every instance it will just not work out of the box. It will fail to connect to the graphql endpoint on localhost:4200. Sometimes it worked to set the docker internal ip of the container, sometimes it only worked to set the public ip (very insecure!), but it just never works out of the box - which is very annoying.
Am I missing something?

Steps I usually do
• new ubuntu server
• install docker (official repo) & docker-compose
• apt install python3 python3-dev python3-pip
• pip install prefect
• prefect backend server
• prefect server start
• prefect agent local start
And then I won't get a connection but it will redirect me to the "Welcome to your prefect ui" screen, where I try out one of the abovementioned IPs and - if I'm lucky - it will work, if not it will not work at all on that machine, even when pruning docker & reinstalling everything

curl localhost:4200, 127.0.0.1:4200, dockerinternalip:4200 all work fine

michael054: Hey <@U01QR9QMS4E>, this is concerning. I'll open an issue to track this in our Github repo as I'll need to spin up new machines to test this. One thing I've had success with in the past is using pip install docker-compose

michael054: <@ULVA73B9P> open "Server consistently fails to start on Ubuntu" in server

Original thread can be found here.

@JustinGuese
Copy link

JustinGuese commented Mar 11, 2021

Ubuntu server 20.04
Python 3.8.5
pip 20.0.2
prefect - multiple installations via pip, source from github (python setup.py install)
one example (but same problem on other ubuntu installations (local, VM, aws)
{
"config_overrides": {},
"env_vars": [],
"system_information": {
"platform": "Linux-5.4.0-1038-aws-x86_64-with-glibc2.29",
"prefect_backend": "server",
"prefect_version": "0.14.12",
"python_version": "3.8.5"
}
}

Problem appears at
"Prefect Server GraphQL endpoint" in setup dashboard "Connect the UI"

  • does not work at all: localhost:4200, 127.0.0.1:4200
  • works sometimes: internaldocker ip, e.g. 172.21.0.1:4200
  • works 3/4: public ip (must be exposed -> very insecure)
  • sometimes it does not work at all

@JustinGuese
Copy link

Server startup log

Attaching to tmp_postgres_1, tmp_hasura_1, tmp_graphql_1, tmp_towel_1, tmp_apollo_1, tmp_ui_1
�[36mapollo_1    |�[0m Checking GraphQL service at http://graphql:4201/health ...
�[36mapollo_1    |�[0m Checking GraphQL service at http://graphql:4201/health ...
�[33mgraphql_1   |�[0m 
�[33mgraphql_1   |�[0m Running Alembic migrations...
�[33mgraphql_1   |�[0m INFO  [alembic.runtime.migration] Context impl PostgresqlImpl.
�[33mgraphql_1   |�[0m INFO  [alembic.runtime.migration] Will assume transactional DDL.
�[33mgraphql_1   |�[0m INFO  [alembic.runtime.migration] Running upgrade  -> 27811b58307b, Create extensions and initial settings
�[33mgraphql_1   |�[0m INFO  [alembic.runtime.migration] Running upgrade 27811b58307b -> 72e2cd3e0469, Initial database tables migration
�[33mgraphql_1   |�[0m INFO  [alembic.runtime.migration] Running upgrade 72e2cd3e0469 -> c4d792bdd05e, Add flow run idempotency key
�[33mgraphql_1   |�[0m INFO  [alembic.runtime.migration] Running upgrade c4d792bdd05e -> 3398e4807bfb, Add traversal functions
�[33mgraphql_1   |�[0m INFO  [alembic.runtime.migration] Running upgrade 3398e4807bfb -> b9086bd4b962, Create message table
�[33mgraphql_1   |�[0m INFO  [alembic.runtime.migration] Running upgrade b9086bd4b962 -> c1f317aa658c, Remove state_id foreign keys
�[33mgraphql_1   |�[0m INFO  [alembic.runtime.migration] Running upgrade c1f317aa658c -> 6611fd0ccc73, Simplify run state update triggers
�[33mgraphql_1   |�[0m INFO  [alembic.runtime.migration] Running upgrade 6611fd0ccc73 -> 70528cee0d2b, Add agent persistence
�[33mgraphql_1   |�[0m INFO  [alembic.runtime.migration] Running upgrade 70528cee0d2b -> 9cb7539b7363, Add index on agent_id
�[33mgraphql_1   |�[0m INFO  [alembic.runtime.migration] Running upgrade 9cb7539b7363 -> e148cf9f1e5b, Add task run name
�[33mgraphql_1   |�[0m INFO  [alembic.runtime.migration] Running upgrade e148cf9f1e5b -> 850b76d44332, Add flow run config
�[33mgraphql_1   |�[0m INFO  [alembic.runtime.migration] Running upgrade 850b76d44332 -> 24f10aeee83e, Add label column to flow runs
�[33mgraphql_1   |�[0m INFO  [alembic.runtime.migration] Running upgrade 24f10aeee83e -> 3c87ad7e0b71, Add artifact api
�[33mgraphql_1   |�[0m INFO  [alembic.runtime.migration] Running upgrade 3c87ad7e0b71 -> 57ac2cb01ac1, Add index for task run names
�[33mgraphql_1   |�[0m INFO  [alembic.runtime.migration] Running upgrade 57ac2cb01ac1 -> 7ca57ea2fdff, Add run_config to flow runs and flow groups
�[33mgraphql_1   |�[0m INFO  [alembic.runtime.migration] Running upgrade 7ca57ea2fdff -> 9116e81c6dc2, Add description to flow group table
�[35mpostgres_1  |�[0m The files belonging to this database system will be owned by user "postgres".
�[35mpostgres_1  |�[0m This user must also own the server process.
�[35mpostgres_1  |�[0m 
�[35mpostgres_1  |�[0m The database cluster will be initialized with locale "en_US.utf8".
�[35mpostgres_1  |�[0m The default database encoding has accordingly been set to "UTF8".
�[35mpostgres_1  |�[0m The default text search configuration will be set to "english".
�[35mpostgres_1  |�[0m 
�[35mpostgres_1  |�[0m Data page checksums are disabled.
�[35mpostgres_1  |�[0m 
�[35mpostgres_1  |�[0m fixing permissions on existing directory /var/lib/postgresql/data ... ok
�[35mpostgres_1  |�[0m creating subdirectories ... ok
�[35mpostgres_1  |�[0m selecting default max_connections ... 100
�[35mpostgres_1  |�[0m selecting default shared_buffers ... 128MB
�[35mpostgres_1  |�[0m selecting default timezone ... Etc/UTC
�[35mpostgres_1  |�[0m selecting dynamic shared memory implementation ... posix
�[35mpostgres_1  |�[0m creating configuration files ... ok
�[35mpostgres_1  |�[0m running bootstrap script ... ok
�[35mpostgres_1  |�[0m performing post-bootstrap initialization ... ok
�[35mpostgres_1  |�[0m syncing data to disk ... ok
�[35mpostgres_1  |�[0m 
�[35mpostgres_1  |�[0m Success. You can now start the database server using:
�[35mpostgres_1  |�[0m 
�[35mpostgres_1  |�[0m     pg_ctl -D /var/lib/postgresql/data -l logfile start
�[35mpostgres_1  |�[0m 
�[35mpostgres_1  |�[0m 
�[35mpostgres_1  |�[0m WARNING: enabling "trust" authentication for local connections
�[35mpostgres_1  |�[0m You can change this by editing pg_hba.conf or using the option -A, or
�[35mpostgres_1  |�[0m --auth-local and --auth-host, the next time you run initdb.
�[35mpostgres_1  |�[0m waiting for server to start....2021-03-11 15:33:44.599 UTC [54] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
�[35mpostgres_1  |�[0m 2021-03-11 15:33:44.618 UTC [55] LOG:  database system was shut down at 2021-03-11 15:33:43 UTC
�[35mpostgres_1  |�[0m 2021-03-11 15:33:44.626 UTC [54] LOG:  database system is ready to accept connections
�[35mpostgres_1  |�[0m  done
�[35mpostgres_1  |�[0m server started
�[35mpostgres_1  |�[0m 2021-03-11 15:33:45.354 UTC [90] FATAL:  database "prefect_server" does not exist
�[35mpostgres_1  |�[0m CREATE DATABASE
�[35mpostgres_1  |�[0m 
�[35mpostgres_1  |�[0m 
�[35mpostgres_1  |�[0m /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
�[35mpostgres_1  |�[0m 
�[35mpostgres_1  |�[0m 2021-03-11 15:33:45.385 UTC [54] LOG:  received fast shutdown request
�[35mpostgres_1  |�[0m waiting for server to shut down....2021-03-11 15:33:45.388 UTC [54] LOG:  aborting any active transactions
�[35mpostgres_1  |�[0m 2021-03-11 15:33:45.391 UTC [54] LOG:  background worker "logical replication launcher" (PID 61) exited with exit code 1
�[35mpostgres_1  |�[0m 2021-03-11 15:33:45.391 UTC [56] LOG:  shutting down
�[35mpostgres_1  |�[0m 2021-03-11 15:33:45.407 UTC [54] LOG:  database system is shut down
�[35mpostgres_1  |�[0m  done
�[35mpostgres_1  |�[0m server stopped
�[35mpostgres_1  |�[0m 
�[35mpostgres_1  |�[0m PostgreSQL init process complete; ready for start up.
�[35mpostgres_1  |�[0m 
�[35mpostgres_1  |�[0m 2021-03-11 15:33:45.503 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
�[35mpostgres_1  |�[0m 2021-03-11 15:33:45.503 UTC [1] LOG:  listening on IPv6 address "::", port 5432
�[35mpostgres_1  |�[0m 2021-03-11 15:33:45.508 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
�[35mpostgres_1  |�[0m 2021-03-11 15:33:45.543 UTC [92] LOG:  database system was shut down at 2021-03-11 15:33:45 UTC
�[35mpostgres_1  |�[0m 2021-03-11 15:33:45.551 UTC [1] LOG:  database system is ready to accept connections
�[36;1mui_1        |�[0m 👾👾👾 UI running at localhost:8080 👾👾👾
�[36mapollo_1    |�[0m Checking GraphQL service at http://graphql:4201/health ...
�[34mtowel_1     |�[0m {"severity": "ERROR", "name": "prefect-server.ZombieKiller", "message": "Unexpected error: ValueError([{'extensions': {'path': '$.selectionSet.task_run', 'code': 'validation-failed'}, 'message': 'field \"task_run\" not found in type: \\'query_root\\''}])"}
�[34mtowel_1     |�[0m {"severity": "ERROR", "name": "prefect-server.Scheduler", "message": "Unexpected error: ValueError([{'extensions': {'path': '$.selectionSet.flow', 'code': 'validation-failed'}, 'message': 'field \"flow\" not found in type: \\'query_root\\''}])"}
�[34mtowel_1     |�[0m {"severity": "ERROR", "name": "prefect-server.Lazarus", "message": "Unexpected error: ValueError([{'extensions': {'path': '$.selectionSet.flow_run', 'code': 'validation-failed'}, 'message': 'field \"flow_run\" not found in type: \\'query_root\\''}])"}
�[32mhasura_1    |�[0m {"type":"http-log","timestamp":"2021-03-11T15:33:53.720+0000","level":"error","detail":{"operation":{"user_vars":{"x-hasura-role":"admin"},"error":{"path":"$.selectionSet.task_run","error":"field \"task_run\" not found in type: 'query_root'","code":"validation-failed"},"request_id":"e66c04fd-21fd-47e5-9457-643d1a75abed","response_size":122,"query":{"variables":{},"query":"query {\n    select: task_run(where: { state: { _eq: \"Running\" }, flow_run: { heartbeat: { _lte: \"2021-03-11T15:23:53.689572+00:00\" } }, task: { flow: { flow_group: { _not: { settings: { _contains: { heartbeat_enabled: false } } } } } } }, order_by: { updated: desc }, limit: 5000) {\n        id\n        flow_run_id\n        tenant_id\n        flow_run {\n            state\n        }\n        task {\n            retry_delay\n            max_retries\n        }\n        retry_count: states_aggregate(where: { state: { _eq: \"Retrying\" } }) {\n            aggregate {\n                count\n            }\n        }\n    }\n}"}},"http_info":{"status":400,"http_version":"HTTP/1.1","url":"/v1alpha1/graphql","ip":"172.23.0.6","method":"POST","content_encoding":null}}}
�[32mhasura_1    |�[0m {"type":"http-log","timestamp":"2021-03-11T15:33:53.720+0000","level":"error","detail":{"operation":{"user_vars":{"x-hasura-role":"admin"},"error":{"path":"$.selectionSet.flow","error":"field \"flow\" not found in type: 'query_root'","code":"validation-failed"},"request_id":"0ec41e66-d27f-48d9-8faf-8ee1d1de9ee0","response_size":114,"query":{"variables":{},"query":"query {\n    select: flow(where: { is_schedule_active: { _eq: true }, archived: { _eq: false } }, order_by: [{ flow_runs_aggregate: { max: { scheduled_start_time: asc_nulls_last } } }], offset: 0, limit: 500) {\n        id\n    }\n}"}},"http_info":{"status":400,"http_version":"HTTP/1.1","url":"/v1alpha1/graphql","ip":"172.23.0.6","method":"POST","content_encoding":null}}}
�[32mhasura_1    |�[0m {"type":"http-log","timestamp":"2021-03-11T15:33:53.720+0000","level":"error","detail":{"operation":{"user_vars":{"x-hasura-role":"admin"},"error":{"path":"$.selectionSet.flow_run","error":"field \"flow_run\" not found in type: 'query_root'","code":"validation-failed"},"request_id":"a9a079ee-0b1b-4677-af43-2e6f41bcaadd","response_size":122,"query":{"variables":{},"query":"query {\n    select: flow_run(where: { state: { _in: [\"Running\", \"Submitted\"] }, heartbeat: { _lte: \"2021-03-11T15:23:53.683912+00:00\" }, _and: [{ _not: { task_runs: { state: { _in: [\"Scheduled\", \"Paused\", \"Resume\", \"Retrying\", \"Running\", \"Cancelling\"] } } } }, { _not: { flow: { flow_group: { _or: [{ settings: { _contains: { heartbeat_enabled: false } } }, { settings: { _contains: { lazarus_enabled: false } } }] } } } }] }, order_by: { updated: asc }, limit: 5000) {\n        id\n        version\n        times_resurrected\n        tenant_id\n    }\n}"}},"http_info":{"status":400,"http_version":"HTTP/1.1","url":"/v1alpha1/graphql","ip":"172.23.0.6","method":"POST","content_encoding":null}}}
�[33mgraphql_1   |�[0m Applied Hasura metadata from /prefect-server/services/hasura/migrations/metadata.yaml
�[33mgraphql_1   |�[0m 
�[33mgraphql_1   |�[0m Database upgraded!
�[36mapollo_1    |�[0m Checking GraphQL service at http://graphql:4201/health ...
�[33mgraphql_1   |�[0m INFO:     Started server process [7]
�[33mgraphql_1   |�[0m INFO:     Waiting for application startup.
�[33mgraphql_1   |�[0m INFO:     Application startup complete.
�[33mgraphql_1   |�[0m INFO:     Uvicorn running on http://0.0.0.0:4201 (Press CTRL+C to quit)
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:60906 - "GET /health HTTP/1.1" 200 OK
�[36mapollo_1    |�[0m Checking GraphQL service at http://graphql:4201/health ...
�[36mapollo_1    |�[0m {"status":"ok","version":"2021.03.10"}
�[36mapollo_1    |�[0m GraphQL service healthy!
�[33mgraphql_1   |�[0m INFO:     172.23.0.5:45136 - "GET /health HTTP/1.1" 200 OK
�[36mapollo_1    |�[0m 
�[36mapollo_1    |�[0m > @ serve /apollo
�[36mapollo_1    |�[0m > node dist/index.js
�[36mapollo_1    |�[0m 
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:60922 - "GET /health HTTP/1.1" 200 OK
�[36mapollo_1    |�[0m Building schema...
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:60946 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.5:45170 - "POST /graphql/ HTTP/1.1" 200 OK
�[36mapollo_1    |�[0m Building schema complete!
�[36mapollo_1    |�[0m Server ready at http://0.0.0.0:4200 🚀 (version: 2021.03.10)
�[36mapollo_1    |�[0m Sending telemetry to Prefect Technologies, Inc.: {"source":"prefect_server","type":"startup","payload":{"id":"8ca761c9-5d29-44dc-9abc-7a14bb4dd6c7","prefect_server_version":"2021.03.10","api_version":"0.2.0"}}
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:60966 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.5:45202 - "POST /graphql/ HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.5:45214 - "POST /graphql/ HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:60992 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:60998 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:32772 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:32778 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:32784 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.5:45250 - "POST /graphql/ HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:32798 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:32804 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:32810 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:32816 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:32822 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:32828 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:32834 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:32840 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:32846 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.5:45312 - "POST /graphql/ HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:32860 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:32866 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:32872 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:32878 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:32884 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:32890 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:32896 - "GET /health HTTP/1.1" 200 OK
�[36;1mui_1        |�[0m 172.23.0.7 - - [11/Mar/2021:15:34:23 +0000] "HEAD / HTTP/1.1" 200 0 "-" "curl/7.64.0" "-"
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:32904 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:32910 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.5:45378 - "POST /graphql/ HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:32924 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:32930 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:32936 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:32942 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:32948 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:32954 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:32960 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:32966 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:32972 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.5:45438 - "POST /graphql/ HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:32986 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:32992 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:32998 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:33004 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:33010 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:33016 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:33022 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:33028 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:33034 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.5:45500 - "POST /graphql/ HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:33048 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:33054 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:33060 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:33066 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:33072 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:33078 - "GET /health HTTP/1.1" 200 OK
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:33084 - "GET /health HTTP/1.1" 200 OK
�[36;1mui_1        |�[0m 172.23.0.7 - - [11/Mar/2021:15:34:53 +0000] "HEAD / HTTP/1.1" 200 0 "-" "curl/7.64.0" "-"
�[33mgraphql_1   |�[0m INFO:     172.23.0.4:33092 - "GET /health HTTP/1.1" 200 OK

@JustinGuese
Copy link

agent log (can connect to localhost)

prefect agent local start

 ____            __           _        _                    _
|  _ \ _ __ ___ / _| ___  ___| |_     / \   __ _  ___ _ __ | |_
| |_) | '__/ _ \ |_ / _ \/ __| __|   / _ \ / _` |/ _ \ '_ \| __|
|  __/| | |  __/  _|  __/ (__| |_   / ___ \ (_| |  __/ | | | |_
|_|   |_|  \___|_|  \___|\___|\__| /_/   \_\__, |\___|_| |_|\__|
                                           |___/

[2021-03-11 15:29:38,642] INFO - agent | Starting LocalAgent with labels ['ip-10-0-2-105']
[2021-03-11 15:29:38,643] INFO - agent | Agent documentation can be found at https://docs.prefect.io/orchestration/
[2021-03-11 15:29:38,643] INFO - agent | Agent connecting to the Prefect API at http://localhost:4200
[2021-03-11 15:29:38,655] INFO - agent | Waiting for flow runs...
``

@zanieb
Copy link
Contributor

zanieb commented Mar 11, 2021

cc @znicholasbrown -- Server appears to be starting correctly and the API is contactable by curl and the LocalAgent but it looks like the UI is having connection issues.

@JustinGuese - The API must be accessible from the browser that is using the UI since the client makes requests directly to the API. This means if you browse the UI (hosted on machine A) from machine B then you must be able to hit the graphql endpoint from machine B or the UI will not work. This means that both the UI and API must be publicly exposed.

From that UI dashboard you'll want to set the API endpoint to be the public route to the API. You can set the default value for this for users of your UI with the config key server.ui.apollo_url when starting Prefect Server.

@JustinGuese
Copy link

Perfect, thanks very much! Wasn't clear to me, but that helps a lot for clarity

@zanieb zanieb changed the title Server consistently fails to start on Ubuntu UI cannot connect to Prefect Server hosted on Ubuntu VM Mar 11, 2021
@zanieb
Copy link
Contributor

zanieb commented Mar 11, 2021

Sweet :)

@zanieb zanieb closed this as completed Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants