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

Connection refused for Postgres Service, but works on Github #1861

Closed
epetre opened this issue Jun 12, 2023 · 1 comment
Closed

Connection refused for Postgres Service, but works on Github #1861

epetre opened this issue Jun 12, 2023 · 1 comment
Labels
kind/bug Something isn't working

Comments

@epetre
Copy link

epetre commented Jun 12, 2023

Bug report info

╰─ act --bug-report                               ─╯
act version:            0.2.46
GOOS:                   darwin
GOARCH:                 amd64
NumCPU:                 12
Docker host:            DOCKER_HOST environment variable is not set
Sockets found:
        /var/run/docker.sock
        $HOME/.docker/run/docker.sock
Config files:
        /Users/emanuelpetre/.actrc:
                -P ubuntu-latest=catthehacker/ubuntu:act-latest
                -P ubuntu-22.04=catthehacker/ubuntu:act-22.04
                -P ubuntu-20.04=catthehacker/ubuntu:act-20.04
                -P ubuntu-18.04=catthehacker/ubuntu:act-18.04
Build info:
        Go version:            go1.20.4
        Module path:           command-line-arguments
        Main version:
        Main path:
        Main checksum:
        Build settings:
                -buildmode:           exe
                -compiler:            gc
                -ldflags:             -X main.version=0.2.46
                CGO_ENABLED:          1
                CGO_CFLAGS:
                CGO_CPPFLAGS:
                CGO_CXXFLAGS:
                CGO_LDFLAGS:
                GOARCH:               amd64
                GOOS:                 darwin
                GOAMD64:              v1
Docker Engine:
        Engine version:        24.0.2
        Engine runtime:        runc
        Cgroup version:        2
        Cgroup driver:         cgroupfs
        Storage driver:        overlay2
        Registry URI:          https://index.docker.io/v1/
        OS:                    Docker Desktop
        OS type:               linux
        OS version:
        OS arch:               x86_64
        OS kernel:             5.15.49-linuxkit-pr
        OS CPU:                4
        OS memory:             7959 MB
        Security options:
                name=seccomp,profile=builtin
                name=cgroupns

Command used with act

act -j test

Describe issue

This works as is on Github, but using act, it complains about not being able to connect to Postgres.

Link to GitHub repository

No response

Workflow content

runs-on: ubuntu-latest

    services:
      postgres:
        image: postgres:14
        env:
          POSTGRES_USER: postgres
          POSTGRES_PASSWORD: password
        ports:
          - 5432:5432
        options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

      redis:
        image: redis
        ports:
          - 6379:6379
        options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5


...

    - name: Database setup
      env:
        PGHOST: localhost
        PGUSER: postgres
        PGPASSWORD: password
      run: |
        bundle exec rails db:create
        bundle exec rails db:schema:load
        bundle exec rails db:test:prepare

Relevant log output

[Rspec/test] ⭐ Run Main Database setup
[Rspec/test]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/3] user= workdir=
| Running via Spring preloader in process 1357
| connection to server at "::1", port 5432 failed: Connection refused
|       Is the server running on that host and accepting TCP/IP connections?
| connection to server at "127.0.0.1", port 5432 failed: Connection refused
|       Is the server running on that host and accepting TCP/IP connections?
...
| Caused by:
| PG::ConnectionBad: connection to server at "::1", port 5432 failed: Connection refused
|       Is the server running on that host and accepting TCP/IP connections?
| connection to server at "127.0.0.1", port 5432 failed: Connection refused

Additional information

No response

@epetre epetre added the kind/bug Something isn't working label Jun 12, 2023
@ZauberNerd
Copy link
Contributor

This is a duplicate of: #173
Services are not yet implemented.

@ZauberNerd ZauberNerd closed this as not planned Won't fix, can't repro, duplicate, stale Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants