Current lemmy.hjson configuration file (with or without the closing bracket…both do not work):

{
  # the domain name of your instance (eg "lemmy.ml")
  hostname: "beehaw.org"
  # Settings related to activitypub federation
  federation: {
    # Whether to enable activitypub federation.
    enabled: true
    # Allows and blocks are described here:
    # https://join-lemmy.org/docs/en/federation/administration.html///instance-allowlist-and-blocklist
    #
    # list of instances with which federation is allowed
    allowed_instances: [
      lemmy.ca
      midwest.social
      /* ... */
    ]
    # Instances which we never federate anything with (but previously federated objects are unaffected)
    blocked_instances: [
      string
      /* ... */
    ]
    # If true, only federate with instances on the allowlist and block everything else. If false
    # use allowlist only for remote communities, and posts/comments in local communities
    # (meaning remote communities will show content from arbitrary instances).
    strict_allowlist: true
    }
}

Docker logs:

lemmy_1     | thread 'main' panicked at 'Error connecting to postgres://lemmy:password@localhost:5432/lemmy', src/main.rs:65:25
lemmy_1     | note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
lemmy_lemmy_1 exited with code 101
lemmy_1     | 2022-01-23T12:53:58.959887Z ERROR r2d2: could not connect to server: Connection refused
lemmy_1     | 	Is the server running on host "localhost" (127.0.0.1) and accepting
lemmy_1     | 	TCP/IP connections on port 5432?
lemmy_1     | could not connect to server: Address not available
lemmy_1     | 	Is the server running on host "localhost" (::1) and accepting
lemmy_1     | 	TCP/IP connections on port 5432?

Safari browser throws this error when attempting to reach https://beehaw.org

https://beehaw.org/404?err=FetchError:%20request%20to%20http://lemmy:8536/api/v3/site?%20failed,%20reason:%20connect%20ECONNREFUSED%20172.23.0.4:8536

So, my instance is connecting from a secured HTTPS and the lemmy connection is attempting to connect to an unsecured HTTP.

docker-compose.yml:

version: '2.2'

services:
  postgres:
    image: postgres:12-alpine
    environment:
      - POSTGRES_USER=lemmy
      - POSTGRES_PASSWORD=thr33n1n3
      - POSTGRES_DB=lemmy
    volumes:
      - ./volumes/postgres:/var/lib/postgresql/data
    restart: always

  lemmy:
    image: dessalines/lemmy:0.15.1
    ports:
      - "127.0.0.1:8536:8536"
    restart: always
    environment:
      - RUST_LOG="warn,lemmy_server=info,lemmy_api=info,lemmy_api_common=info,lemmy_api_crud=info,lemmy_apub=info,lemmy_db_schema=info,lemmy_db_views=info,lemmy_db_views_ac>
    volumes:
      - ./lemmy.hjson:/config/config.hjson
    depends_on:
      - postgres
      - pictrs

  lemmy-ui:
    image: beehaw/frontend-ui:latest
    ports:
      - "127.0.0.1:1235:1234"
    restart: always
    environment:
      - LEMMY_INTERNAL_HOST=lemmy:8536
      - LEMMY_EXTERNAL_HOST=beehaw.org
      - LEMMY_HTTPS=false
    depends_on:
      - lemmy

  pictrs:
    image: asonix/pictrs:v0.2.6-r2
    ports:
      - "127.0.0.1:8537:8080"
    user: 991:991
    volumes:
      - ./volumes/pictrs:/mnt
    restart: always
Dessalines
mod
link
fedilink
02Y

Post your docker compose file. Your database credentials are wrong, so its not connecting.

How did you install this, docker or ansible?

@suspended@lemmy.ml
creator
link
fedilink
22Y

Installed with Docker, yes. I’ve edited the post to include docker-compose.yml file. Thanks.

Dessalines
mod
link
fedilink
12Y

Reread this page: https://join-lemmy.org/docs/en/administration/install_docker.html

You missed some instructions having to do with a custom database password.

@suspended@lemmy.ml
creator
link
fedilink
12Y

I did not miss those instructions. I set a custom database password several months ago.

Just to be clear, the only file (or anything for that matter) that I changed yesterday was the lemmy.hjson configuration file. Absolutely nothing else was changed on the server.

Dessalines
mod
link
fedilink
12Y

your lemmy.hjson is missing db creds, it clearly says that in the doc I linked.

@suspended@lemmy.ml
creator
link
fedilink
02Y

I’ve added those creds back in and I’m getting this in the Docker logs:

lemmy_1 | 2022-01-23T19:46:10.980030Z ERROR r2d2: FATAL: password authentication failed for user "lemmy"

Also, browser still throws:

https://beehaw.org/404?err=FetchError:%20request%20to%20http://lemmy:8536/api/v3/site?%20failed,%20reason:%20connect%20ECONNREFUSED%20172.30.0.4:8536

Not sure what to try next. Any ideas? Thanks again for the help.

Dessalines
mod
link
fedilink
12Y

Its telling you the exact error. You either used a different db user than lemmy, or have the wrong password. I don’t have your original lemmy hjson before you deleted it, so i can’t be sure.

@suspended@lemmy.ml
creator
link
fedilink
02Y

I went to the server and logged into PostgeSQL. I used the \du command to list all the users. There are only 2 users. Namely, ‘postgres’ and ‘admin’. There isn’t a ‘lemmy’ user. So, why am I getting an error that states:

password authentication failed for user "lemmy"?

Dessalines
mod
link
fedilink
12Y

Reread my comment, and post your new lemmy.hjson.

@suspended@lemmy.ml
creator
link
fedilink
12Y
{
  # for more info about the config, check out the documentation
  # https://join-lemmy.org/docs/en/administration/configuration.html

   # settings related to the postgresql database
   # address where pictrs is available
   pictrs_url: "http://pictrs:8080"
   database: {
    # name of the postgres database for lemmy
    database: "lemmy"
    # username to connect to postgres
    user: "lemmy"
    # password to connect to postgres
    password: “baconshit”
    # host where postgres is running
    host: "postgres"
    # port where postgres can be accessed
    port: 5432
    # maximum number of active sql connections
    pool_size: 5
  }
    # the domain name of your instance (eg "lemmy.ml")
  hostname: "beehaw.org"
    # Settings related to activitypub federation
  federation: {
    # Whether to enable activitypub federation.
    enabled: true
    # Allows and blocks are described here:
    # https://join-lemmy.org/docs/en/federation/administration.html///instance-allowlist-and-blocklist
    #
    # list of instances with which federation is allowed
    allowed_instances: [
      lemmy.ca
      midwest.social
      /* ... */
    ]
    # Instances which we never federate anything with (but previously federated objects are unaffected)
    blocked_instances: [
      string
      /* ... */
    ]
    # If true, only federate with instances on the allowlist and block everything else. If false
    # use allowlist only for remote communities, and posts/comments in local communities
    # (meaning remote communities will show content from arbitrary instances).
    strict_allowlist: true
  }
#  tls_enabled: true
}
Dessalines
mod
link
fedilink
02Y

Check your database block. You have the wrong username. Did you save your old config before overwriting it?

@suspended@lemmy.ml
creator
link
fedilink
0
edit-2
2Y

In the lemmy.hjson I had the wrong database name. I’ve changed it to 'beehaw_db which I can see the ‘owner’, in postgres itself, is ‘admin’. So, I changed the username to ‘admin’ in the same hjson file.

Now, I’m getting:

lemmy_1 | 2022-01-24T15:57:58.976448Z ERROR r2d2: FATAL: password authentication failed for user "admin"

Dessalines
mod
link
fedilink
02Y

Its telling you your password is wrong. What do you want me to do.

@suspended@lemmy.ml
creator
link
fedilink
0
edit-2
2Y

Maybe I’ve missed something, but let me tell you what I’ve done and see if you can catch anything that I may have done wrong. OK?

I first logged into PostgreSQL and used the ALTER ROLE to change the password of the user that is accessing the ‘beehaw_db’ database. I made sure that this exact password is entered properly in both the docker-compose.yml and lemmy.hjson files.

I’m still getting the same authentication error. Am I missing something? What would you recommend as far as troubleshooting this?

Dessalines
mod
link
fedilink
-12Y

password authentication failed for user “admin”

@suspended@lemmy.ml
creator
link
fedilink
02Y

Another developer, on Matrix yesterday, told me that the only required field was hostname.

Dessalines
mod
link
fedilink
22Y

That’s correct, you don’t need those, unless you use a custom db config, which you did in this case.

Hi, there, Dessalines!

Thanks for helpin’ us out, here. I’m also trying to help suspended get our lemmy page back up and running. I was wondering if the following error, from the network activity log pasted in the original post, has any merit in this instance:

https://beehaw.org/404?err=FetchError: request to http://lemmy:8536/api/v3/site? failed, reason: connect ECONNREFUSED 172.23.0.4:8536

You see how the beehaw request is coming from HTTPS and is requesting from the HTTP, non-SSL certified lemmy API? Wouldn’t that be a reason for a connection refusal? I had always assumed that this was a woefully unacceptable transaction. I could be wrong.

Thanks again!

Dessalines
mod
link
fedilink
02Y

No the issue is a db one, the docker is just forwarding an error message because internally the lemmy isomorphic ui doesn’t communicate over https.

Support / questions about Lemmy.

  • 0 users online
  • 12 users / day
  • 24 users / week
  • 26 users / month
  • 19 users / 6 months
  • 11 subscribers
  • 140 Posts
  • 444 Comments
  • Modlog