root@0ef891f171ee/-(o_o)-\0ef891f171ee:/usr/local/lib/python3.8/site-packages/dispatch# dispatch database restore --dump-file /root/dispatch-sample-data.dump
Traceback (most recent call last):
File "/usr/local/bin/dispatch", line 8, in <module>
sys.exit(entrypoint())
File "/usr/local/lib/python3.8/site-packages/dispatch/cli.py", line 843, in entrypoint
dispatch_cli()
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/dispatch/cli.py", line 511, in restore_database
from sh import psql, createdb
ImportError: cannot import name 'psql' from 'sh' (/usr/local/lib/python3.8/site-packages/sh.py)
okay all working now.
I was dropping the database before, but the issue was my
POSTGRES_USERandDATABASE_CREDENTIALSwere not set to ‘dispatch’ as the database code was assuming in ‘data/dispatch-sample-data.dump’, even though they were matching. I had my own .env file from before .env.example was updated, so didn’t use defaults in current .env.exampleso this is really handy but i think if we can incorporate in the deployment process, or at least make it very easy to do, it would be awesome.
my two cents:
POSTGRES_USERorDATABASE_CREDENTIALSisThanks again, now i have something to play with
@mogindi the issue with multiple heads issue was fixed in: https://github.com/Netflix/dispatch/commit/cc47103b223838a30dc3d5ab22da33300fea2bdf