Cam

Cam

(invalid_authorization_specification) role "runner" does not exist

Hey All,

I’m having an issue setting up Github actions. I’ve found this helpful link for standard elixir workflow .yml files: GitHub - actions/setup-elixir: Set up your GitHub Actions workflow with OTP and Elixir · GitHub

Here is my current elixir.yml

name: Elixir CI

on: push

jobs:
  test:
    runs-on: ubuntu-latest

    services:
      db:
        image: postgres:11
        ports: ['5432:5432']
        options: >-
          --health-cmd pg_isready
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5

    steps:
      - uses: actions/checkout@v1.0.0
      - uses: actions/setup-elixir@v1.0.0
        with:
          otp-version: 22.x
          elixir-version: 1.9.2
      - run: mix deps.get
      - run: mix test

But when this runs I’m getting this error during the mix test portion:

01:16:43.654 [error] GenServer #PID<0.7572.0> terminating
** (Postgrex.Error) FATAL 28000 (invalid_authorization_specification) role "runner" does not exist
    (db_connection) lib/db_connection/connection.ex:87: DBConnection.Connection.connect/2
    (connection) lib/connection.ex:622: Connection.enter_connect/5
    (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Last message: nil
** (Mix) The database for Statcasters.Repo couldn't be created: killed
##[error]Process completed with exit code 1.

Can anybody help me understand what is going on here? Thank you!

#ci

First Post!

ramortegui

ramortegui

@Cam Did you get it fixed? I’m having the same issue.

Most Liked

al2o3cr

al2o3cr

I didn’t see the string runner anywhere in the link to setup_elixir; is that something coming from the Phoenix application’s config?

You may need to configure the postgres container this sets up, to get the right user + database - check the Docker Hub page for a description of the available options. My parsing of the Actions docs is that you’ll want to add them under the db key in the above YAML.

ramortegui

ramortegui

I used a GitHub-Actions file from another project, and it turned out that the new one didn’t have defined the username and password for the database connection on the config/test.exs. But, it was working locally using the default credentials of the user running the test.

The solution was to add username and password on config/dev.exs as @al2o3cr suggested.

Where Next?

Popular in Questions Top

jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New

Other popular topics Top

Qqwy
Update: How to use the Blogs &amp; Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3271 131117 1222
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 40165 209
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New

We're in Beta

About us Mission Statement