Hello everyone!! I’m trying to register a flow fro...
# prefect-server
r
Hello everyone!! I’m trying to register a flow from my Gitlab server as a part of a CI/CD pipeline…but I’m always getting this error:
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=4200): Max retries exceeded with url: /graphql (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f373f0b32b0>: Failed to establish a new connection: [Errno 111] Connection refused'))
I have installed prefect in a virtual enviroment during pipeline execution and also set up ./prefect/config.toml with [servers] host=“ip_to_host” but I only see localhost in the error. Also the EC2 instances have all necessary ports opened and prefect is set up as backend server
part of the test pipeline is:
Copy code
variables:
  PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"

# Pip's cache doesn't store the python packages
# <https://pip.pypa.io/en/stable/reference/pip_install/#caching>
#
# If you want to also cache the installed packages, you have to install
# them in a virtualenv and cache it as well.
cache:
  paths:
    - .cache/pip
    - venv/

before_script:
  - python -V  # Print out python version for debugging
  - pip install virtualenv
  - virtualenv venv
  - source venv/bin/activate


test:
  script:
    - pip install -Iv prefect==0.14.19
    - prefect version #for debugging
    - mkdir .prefect
    - touch .prefect/config.toml
    - echo -e '[server]\nhost="<http://ip_to_prefect_server>"' > .prefect/config.toml
    - prefect backend server
    - prefect register --project raulTesting -p /builds/dmed/soa/prefect/overon_get_missing_test/overon_get_missing_gitlab.py -l "nld_migration"
  tags:
    - local-host
I’m really stuck on this and maybe I need another pair of eyes…THX
I forgot to say that the gitlab runners are docker executers….one is directly running in the host and another one is a docker container but with network = host as I’m trying to debug this problem
k
Hey @Raúl Mansilla, hard to pinpoint what’s going on but you are right that the
localhost
does seem to be the issue. I guess we need to test if that
config.toml
is being picked up? Not sure how to test right now, will ask the team.
n
@Raúl Mansilla it looks like you have
servers
as your config.toml section header, which should be
server
, try adjusting that
r
@nicholas going to check that out…hope that silly thing is the issue…
n
If that doesn't work I'd also check that you're creating
.prefect/config.toml
in the correct location; I believe it needs to be in the home directory (
~
)
r
nope, it doesn’t work…in the pipeline I have [server] …. I’m going to check the home thing. thanks
👍 1
Now works…thanks @nicholas, it works with ~/.prefect Sometimes you didn’t see the silly things by yourself 🙂
n
Ah perfect, glad you got it sorted! 😄
🙌 1