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

uvicorn error upon running ./run_skyvern.sh #319

Closed
devinat1 opened this issue May 15, 2024 · 10 comments
Closed

uvicorn error upon running ./run_skyvern.sh #319

devinat1 opened this issue May 15, 2024 · 10 comments

Comments

@devinat1
Copy link

I am getting the following upon running ./run_skyvern.sh on Ubuntu 22.04:

./run_skyvern.sh
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Installing dependencies from lock file

No dependencies to install or update

Installing the current project: skyvern (0.1.0)
Alembic mode:  online
INFO  [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO  [alembic.runtime.migration] Will assume transactional DDL.
Alembic mode:  online
INFO  [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO  [alembic.runtime.migration] Will assume transactional DDL.
No new upgrade operations detected.
2024-05-15T02:46:21.513180Z [info     ] Agent server starting.         host=0.0.0.0 port=8000
INFO:     Will watch for changes in these directories: ['/home/bond/Desktop/darkpatterncombined/agents/skyvern']
INFO:     Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
INFO:     Started reloader process [293558] using WatchFiles
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/bond/Desktop/darkpatterncombined/agents/skyvern/skyvern/forge/__main__.py", line 20, in <module>
    uvicorn.run("skyvern.forge.api_app:app", host="0.0.0.0", port=port, log_level="info", reload=reload)
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/uvicorn/main.py", line 582, in run
    ChangeReload(config, target=server.run, sockets=[sock]).run()
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/uvicorn/supervisors/basereload.py", line 50, in run
    for changes in self:
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/uvicorn/supervisors/basereload.py", line 69, in __next__
    return self.should_restart()
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/uvicorn/supervisors/watchfilesreload.py", line 87, in should_restart
    changes = next(self.watcher)
              ^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/watchfiles/main.py", line 118, in watch
    with RustNotify(
         ^^^^^^^^^^^
PermissionError: Permission denied (os error 13) about ["/home/bond/Desktop/darkpatterncombined/agents/skyvern/postgres-data/pgdata"]
2024-05-14 22:46:23 [info     ] Registering LLM config         llm_key=OPENAI_GPT4_TURBO
2024-05-14 22:46:23 [info     ] Registering LLM config         llm_key=OPENAI_GPT4V
2024-05-15T02:46:23.901045Z [info     ] Initializing ForgeAgent        browser_action_timeout_ms=5000 browser_type=chromium-headful debug_mode=False env=local execute_all_steps=True long_running_task_warning_ratio=0.95 max_scraping_retries=0 max_steps_per_run=50 video_path=./videos
2024-05-15T02:46:24.187635Z [info     ] Starting the skyvern scheduler.
2024-05-15T02:46:24.188285Z [info     ] Server startup complete. Skyvern is now online

This is after a successful ./setup.sh script run.

@suchintan
Copy link
Contributor

@devinat1 is your postgres configured to require a password for all user roles? We have a known issue with our setup script in situations like that. Our setup script currently creates a passwordless user, which often fails on Linux (Ubuntu) because the default postgres has password required on new dbs

@LawyZheng
Copy link
Collaborator

I guess this is caused by the reason that he tried to mix-use docker and local Skyvern.

Our docker-compose will create the DB directory in the <PROJECT_ROOT>/postgres-data, which might not be permitted by the users (root permission I guess).
But our local Skyvern is trying to watch the files change in the <PROJECT_ROOT>/postgres-data, so here comes the permission denied error

@devinat1
Copy link
Author

@devinat1 is your postgres configured to require a password for all user roles? We have a known issue with our setup script in situations like that. Our setup script currently creates a passwordless user, which often fails on Linux (Ubuntu) because the default postgres has password required on new dbs

I didn't alter any of the setup script, so the default configuration exists (clone then run setup.py, with poetry installed through https://python-poetry.org/docs/ with curl -sSL https://install.python-poetry.org | python3 -.

@LawyZheng
Copy link
Collaborator

@devinat1 is your postgres configured to require a password for all user roles? We have a known issue with our setup script in situations like that. Our setup script currently creates a passwordless user, which often fails on Linux (Ubuntu) because the default postgres has password required on new dbs

I didn't alter any of the setup script, so the default configuration exists (clone then run setup.py, with poetry installed through https://python-poetry.org/docs/ with curl -sSL https://install.python-poetry.org | python3 -.

You'd better choose one way to set up, by docker or local.
Never try to mix them unless you know what you're doing!

@devinat1
Copy link
Author

It wasn't me mixing, but rather I tried locally, then tried via docker compose thereafter. It would be good if one ran without interfering with the other, since in practice it is difficult to uninstall the local install.

@LawyZheng
Copy link
Collaborator

Yeah, we will figure it out.
But for now, if you want to use ./run_skyvern.sh to set up in the local.
Can you just remove the postgres-data directory? I think this error won't happen.

Or if you're familiar with docker, you can try to set up the postgres in another directory, or as an individual container.
Then, you could fix this problem.

@devinat1
Copy link
Author

Ok, I ran the command docker compose down --rmi all -v to delete all images and volumes, and deleted all other docker data through the disk usage docker extension in which I reclaimed all space. Then, I reran the local script ./run_skyvern.sh after deleting the postgres-data directory and received the following:

Installing the current project: skyvern (0.1.0)
Alembic mode:  online
Traceback (most recent call last):
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 146, in __init__
    self._dbapi_connection = engine.raw_connection()
                             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 3300, in raw_connection
    return self.pool.connect()
           ^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 449, in connect
    return _ConnectionFairy._checkout(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 1263, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 712, in checkout
    rec = pool._do_get()
          ^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/pool/impl.py", line 308, in _do_get
    return self._create_connection()
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 390, in _create_connection
    return _ConnectionRecord(self)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 674, in __init__
    self.__connect()
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 900, in __connect
    with util.safe_reraise():
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/util/langhelpers.py", line 146, in __exit__
    raise exc_value.with_traceback(exc_tb)
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 896, in __connect
    self.dbapi_connection = connection = pool._invoke_creator(self)
                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/engine/create.py", line 643, in connect
    return dialect.connect(*cargs, **cparams)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 620, in connect
    return self.loaded_dbapi.connect(*cargs, **cparams)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/psycopg/connection.py", line 748, in connect
    raise last_ex.with_traceback(None)
psycopg.OperationalError: connection failed: Connection refused
        Is the server running on that host and accepting TCP/IP connections?

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/bin/alembic", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/alembic/config.py", line 641, in main
    CommandLine(prog=prog).main(argv=argv)
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/alembic/config.py", line 631, in main
    self.run_cmd(cfg, options)
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/alembic/config.py", line 608, in run_cmd
    fn(
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/alembic/command.py", line 403, in upgrade
    script.run_env()
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/alembic/script/base.py", line 583, in run_env
    util.load_python_file(self.dir, "env.py")
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/alembic/util/pyfiles.py", line 95, in load_python_file
    module = load_module_py(module_id, path)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/alembic/util/pyfiles.py", line 113, in load_module_py
    spec.loader.exec_module(module)  # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/bond/Desktop/darkpatterncombined/agents/skyvern/alembic/env.py", line 81, in <module>
    run_migrations_online()
  File "/home/bond/Desktop/darkpatterncombined/agents/skyvern/alembic/env.py", line 70, in run_migrations_online
    with connectable.connect() as connection:
         ^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 3276, in connect
    return self._connection_cls(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 148, in __init__
    Connection._handle_dbapi_exception_noconnection(
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2440, in _handle_dbapi_exception_noconnection
    raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 146, in __init__
    self._dbapi_connection = engine.raw_connection()
                             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 3300, in raw_connection
    return self.pool.connect()
           ^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 449, in connect
    return _ConnectionFairy._checkout(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 1263, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 712, in checkout
    rec = pool._do_get()
          ^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/pool/impl.py", line 308, in _do_get
    return self._create_connection()
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 390, in _create_connection
    return _ConnectionRecord(self)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 674, in __init__
    self.__connect()
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 900, in __connect
    with util.safe_reraise():
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/util/langhelpers.py", line 146, in __exit__
    raise exc_value.with_traceback(exc_tb)
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 896, in __connect
    self.dbapi_connection = connection = pool._invoke_creator(self)
                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/engine/create.py", line 643, in connect
    return dialect.connect(*cargs, **cparams)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 620, in connect
    return self.loaded_dbapi.connect(*cargs, **cparams)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/psycopg/connection.py", line 748, in connect
    raise last_ex.with_traceback(None)
sqlalchemy.exc.OperationalError: (psycopg.OperationalError) connection failed: Connection refused
        Is the server running on that host and accepting TCP/IP connections?
(Background on this error at: https://sqlalche.me/e/20/e3q8)
Alembic mode:  online
Traceback (most recent call last):
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 146, in __init__
    self._dbapi_connection = engine.raw_connection()
                             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 3300, in raw_connection
    return self.pool.connect()
           ^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 449, in connect
    return _ConnectionFairy._checkout(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 1263, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 712, in checkout
    rec = pool._do_get()
          ^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/pool/impl.py", line 308, in _do_get
    return self._create_connection()
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 390, in _create_connection
    return _ConnectionRecord(self)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 674, in __init__
    self.__connect()
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 900, in __connect
    with util.safe_reraise():
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/util/langhelpers.py", line 146, in __exit__
    raise exc_value.with_traceback(exc_tb)
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 896, in __connect
    self.dbapi_connection = connection = pool._invoke_creator(self)
                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/engine/create.py", line 643, in connect
    return dialect.connect(*cargs, **cparams)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 620, in connect
    return self.loaded_dbapi.connect(*cargs, **cparams)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/psycopg/connection.py", line 748, in connect
    raise last_ex.with_traceback(None)
psycopg.OperationalError: connection failed: Connection refused
        Is the server running on that host and accepting TCP/IP connections?

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/bin/alembic", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/alembic/config.py", line 641, in main
    CommandLine(prog=prog).main(argv=argv)
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/alembic/config.py", line 631, in main
    self.run_cmd(cfg, options)
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/alembic/config.py", line 608, in run_cmd
    fn(
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/alembic/command.py", line 290, in check
    script_directory.run_env()
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/alembic/script/base.py", line 583, in run_env
    util.load_python_file(self.dir, "env.py")
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/alembic/util/pyfiles.py", line 95, in load_python_file
    module = load_module_py(module_id, path)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/alembic/util/pyfiles.py", line 113, in load_module_py
    spec.loader.exec_module(module)  # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/bond/Desktop/darkpatterncombined/agents/skyvern/alembic/env.py", line 81, in <module>
    run_migrations_online()
  File "/home/bond/Desktop/darkpatterncombined/agents/skyvern/alembic/env.py", line 70, in run_migrations_online
    with connectable.connect() as connection:
         ^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 3276, in connect
    return self._connection_cls(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 148, in __init__
    Connection._handle_dbapi_exception_noconnection(
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2440, in _handle_dbapi_exception_noconnection
    raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 146, in __init__
    self._dbapi_connection = engine.raw_connection()
                             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 3300, in raw_connection
    return self.pool.connect()
           ^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 449, in connect
    return _ConnectionFairy._checkout(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 1263, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 712, in checkout
    rec = pool._do_get()
          ^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/pool/impl.py", line 308, in _do_get
    return self._create_connection()
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 390, in _create_connection
    return _ConnectionRecord(self)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 674, in __init__
    self.__connect()
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 900, in __connect
    with util.safe_reraise():
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/util/langhelpers.py", line 146, in __exit__
    raise exc_value.with_traceback(exc_tb)
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 896, in __connect
    self.dbapi_connection = connection = pool._invoke_creator(self)
                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/engine/create.py", line 643, in connect
    return dialect.connect(*cargs, **cparams)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 620, in connect
    return self.loaded_dbapi.connect(*cargs, **cparams)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-0Io2OvKr-py3.11/lib/python3.11/site-packages/psycopg/connection.py", line 748, in connect
    raise last_ex.with_traceback(None)
sqlalchemy.exc.OperationalError: (psycopg.OperationalError) connection failed: Connection refused
        Is the server running on that host and accepting TCP/IP connections?
(Background on this error at: https://sqlalche.me/e/20/e3q8)
2024-05-15T04:06:37.631166Z [info     ] Agent server starting.         host=0.0.0.0 port=8000
INFO:     Will watch for changes in these directories: ['/home/bond/Desktop/darkpatterncombined/agents/skyvern']
INFO:     Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
INFO:     Started reloader process [380556] using WatchFiles
2024-05-15 00:06:39 [info     ] Registering LLM config         llm_key=OPENAI_GPT4_TURBO
2024-05-15 00:06:39 [info     ] Registering LLM config         llm_key=OPENAI_GPT4V
2024-05-15T04:06:39.980061Z [info     ] Initializing ForgeAgent        browser_action_timeout_ms=5000 browser_type=chromium-headful debug_mode=False env=local execute_all_steps=True long_running_task_warning_ratio=0.95 max_scraping_retries=0 max_steps_per_run=50 video_path=./videos
2024-05-15T04:06:40.278689Z [info     ] Starting the skyvern scheduler.
2024-05-15T04:06:40.279526Z [info     ] Server startup complete. Skyvern is now online

@LawyZheng
Copy link
Collaborator

Oh, man. You didn't start any DB.

@devinat1
Copy link
Author

devinat1 commented May 15, 2024

So should I run the ./setup.sh script again to have the DB recreated?

@LawyZheng
Copy link
Collaborator

I don't how you run the DB previously.
You can try to run docker run --name postgresql-container -e POSTGRES_HOST_AUTH_METHOD=trust -d -p 5432:5432 postgres:14 to start a DB using docker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants