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

Supabase db-reset command in setup.py fails #71

Open
MoHayat opened this issue Jun 1, 2023 · 2 comments
Open

Supabase db-reset command in setup.py fails #71

MoHayat opened this issue Jun 1, 2023 · 2 comments

Comments

@MoHayat
Copy link

MoHayat commented Jun 1, 2023

I re-cloned the repo and set up my openai api key + supabase credentials, but when running the python setup.py command I keep running into this issue:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/mohayat/projects/GPTeam/src/utils/database/reset.py", line 31, in main
    asyncio.run(reset())
  File "/usr/local/Cellar/[email protected]/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/[email protected]/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/[email protected]/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/Users/mohayat/projects/GPTeam/src/utils/database/reset.py", line 17, in reset
    subprocess.run(["supabase", "db", "reset"])
  File "/usr/local/Cellar/[email protected]/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/[email protected]/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 1024, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/local/Cellar/[email protected]/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 1917, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'supabase'
Traceback (most recent call last):
  File "/Users/mohayat/projects/GPTeam/setup.py", line 66, in <module>
    subprocess.run(["poetry", "run", "db-reset"], check=True)
  File "/Users/mohayat/.pyenv/versions/3.11.0/lib/python3.11/subprocess.py", line 569, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['poetry', 'run', 'db-reset']' returned non-zero exit status 1.

I've tried re-installing the supabase package and re-running the command to no avail.

@kboa
Copy link

kboa commented Jun 11, 2023

+1

@damianesteban
Copy link

damianesteban commented Jul 6, 2023

I was experiencing the same issue:

Installing the current project: 101-ai (0.1.0)
Seed the database...
2023-07-06 15:07:05,943:INFO - NumExpr defaulting to 8 threads.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/damianesteban/src/gpt/GPTeam/src/utils/database/reset.py", line 31, in main
    asyncio.run(reset())
  File "/opt/homebrew/Cellar/[email protected]/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/Users/damianesteban/src/gpt/GPTeam/src/utils/database/reset.py", line 17, in reset
    subprocess.run(["supabase", "db", "reset"])
  File "/opt/homebrew/Cellar/[email protected]/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/opt/homebrew/Cellar/[email protected]/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 1950, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'supabase'
Traceback (most recent call last):
  File "/Users/damianesteban/src/gpt/GPTeam/setup.py", line 66, in <module>
    subprocess.run(["poetry", "run", "db-reset"], check=True)
  File "/opt/homebrew/Cellar/[email protected]/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['poetry', 'run', 'db-reset']' returned non-zero exit status 1.

I was able to resolve this by running the following:

supabase login
supabase link --project-ref PROJECT_REF
supabase db remote commit
supabase start

Then I followed the instructions and it worked perfectly. I hadn't used Supabase for a project before so I wasn't familiar with it.

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