Skip to content

create postgres role stuck #1296

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

Closed
erlangparasu opened this issue Feb 17, 2025 · 1 comment
Closed

create postgres role stuck #1296

erlangparasu opened this issue Feb 17, 2025 · 1 comment

Comments

@erlangparasu
Copy link

Describe the bug

create postgres role stuck

postgresql.role(
            name="Create the pyinfra PostgreSQL role",
            role="pyinfra",
            password="somepassword",
            superuser=True,
            login=True,
            sudo_user="postgres",
        )

To Reproduce

Steps to reproduce the behavior, please include where possible:

postgresql.role(
            name="Create the pyinfra PostgreSQL role",
            role="pyinfra",
            password="somepassword",
            superuser=True,
            login=True,
            sudo_user="postgres",
        )

os: ubuntu jammy
using ssh connector

Expected behavior

role created successfully

Meta

  • Include output of pyinfra --support.

    If you are having issues with pyinfra or wish to make feature requests, please
    check out the GitHub issues at https://github.com/Fizzadar/pyinfra/issues .
    When adding an issue, be sure to include the following:

    System: Darwin
    Platform: macOS-13.7.3-arm64-arm-64bit
    Release: 22.6.0
    Machine: arm64
    pyinfra: v3.2
    click: v8.1.8
    distro: v1.9.0
    gevent: v24.11.1
    jinja2: v3.1.5
    packaging: v24.2
    paramiko: v3.5.1
    python-dateutil: v2.9.0.post0
    pywinrm: v0.5.0
    setuptools: v75.8.0
    typeguard: v4.4.2
    typing-extensions: v4.12.2
    Executable: /Volumes/my_disk/my_backend_deploy/.venv/bin/pyinfra
    Python: 3.12.6 (CPython, Clang 18.1.8 )

  • How was pyinfra installed (source/pip)?
    via uv

  • Include pyinfra-debug.log (if one was created)

  • no error becaause it stuck, wating for input password
  • Consider including output with -vv and --debug.

--> Starting operation: tasks/provision_database_task.py | systemd.service (service=postgresql, running=True)
[ip] >>> sudo -H -n bash -c '! command -v systemctl >/dev/null || systemctl show --all --property Id --property SubState postgresql.service'
[ip] Id=postgresql.service
[ip] SubState=exited
    [ip] Loaded fact systemd.SystemdStatus (machine=None, services=['postgresql.service'], user_mode=False, user_name=None)
    [ip] noop: service postgresql.service is running
    [ip] No changes

--> Starting operation: tasks/provision_database_task.py | Create the pyinfra PostgreSQL role 
[ip] >>> sh -c '! command -v psql >/dev/null || psql -h 127.0.0.1 -p 5432 -Ac '"'"'SELECT * FROM pg_catalog.pg_roles'"'"''
    | {ip}

@erlangparasu
Copy link
Author

solved by omiting psql_host and psql_port

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

1 participant