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

Bash syntax error when attempting to check for database PID #240

Open
ajhalili2006 opened this issue Mar 3, 2021 · 1 comment
Open

Bash syntax error when attempting to check for database PID #240

ajhalili2006 opened this issue Mar 3, 2021 · 1 comment

Comments

@ajhalili2006
Copy link

How to Reproduce

  1. Go to your project's local directory.
  2. Do divio project configure if there's no $PWD/.divio/config.json file. Otherwise, skip.
  3. Ensure you have the docker-compose.yml file.
  4. Run divio project pull db [STAGE] in a terminal.

Expectation vs. Reality

Reality: Bash syntax error just fired up.

Expectation: Database export ran smoothly.

Dumps

gildedguy@andreijiroh:~/git-projects/ThePinsTeam/wiki.js$ divio project pull db live
/home/gildedguy/.local/lib/python3.8/site-packages/divio_cli/localdev/utils.py:218: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  self.config = yaml.load(check_output(docker_compose("config")))
/home/gildedguy/.local/lib/python3.8/site-packages/divio_cli/localdev/utils.py:218: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  self.config = yaml.load(check_output(docker_compose("config")))
 ===> Pulling database from repohubdev-wiki live environment
 ---> Preparing download  [6s]
 ---> Downloading database [4s]
 ---> Starting local database server
      /home/gildedguy/.local/lib/python3.8/site-packages/divio_cli/localdev/utils.py:218: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  self.config = yaml.load(check_output(docker_compose("config")))
Building with native build. Learn about native build in Compose here: https://docs.docker.com/go/compose-native-build/
wikijs_db_1 is up-to-date
      [1s]
 ---> Waiting for local database server [10s]
------------------------------------------------------------------------------------------------------------
There was an error trying to run a command. This is most likely
not an issue with divio-cli, but the called program itself.
Try checking the output of the command above.
The command was:
  docker exec 301e553875925ef50334bc5612c794eaebd2b00c8fae02f1e9c5373a998569dc psql -U postgres -c SELECT pg_terminate_backend(pg_stat_activity.pid) FROM   pg_stat_activity WHERE  pg_stat_activity.datname = 'db'   AND  pid <> pg_backend_pid();
@ajhalili2006
Copy link
Author

Here's what ShellCheck says about that issue.

Screenshot from 2021-03-03 21-35-04

ajhalili2006 pushed a commit to ajhalili2006/divio-cli that referenced this issue Mar 3, 2021
Needs to be tested locally, wait.
ajhalili2006 pushed a commit to ajhalili2006/divio-cli that referenced this issue Mar 3, 2021
Signed-off-by: Andrei Jiroh Eugenio Halili <[email protected]>
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

Successfully merging a pull request may close this issue.

1 participant