juliushaertl / nextcloud-docker-dev

Nextcloud development environment using docker-compose
GNU Affero General Public License v3.0
126 stars 67 forks source link

How to fix postgres? #288

Closed te-online closed 6 months ago

te-online commented 6 months ago

There's a bug in one of my apps that only concerns PostgreSQL. I've tried to follow the readme, but had no luck.

It seems like there's some inconsistency in naming.

When I set SQL=pgsql in .env, docker compose complains about a missing database-pgsql container. Which is fair, because it's not there. There is one called database-postgres, so I renamed it to database-pgsql. But then I'm stuck at the "Installing Container" screen with the message Waiting for other containers and then ⚠ Unable to connect to the PostgreSQL server.

I cannot validate this, because I'm not aware of a contemporary PostgreSQL GUI for Mac, or at least I don't have any installed, and I have yet to learn how to connect using the CLI.

I also tried SQL=postgres in .env without renaming the service. In this scenario I get "Not implemented" on the "Installing Container" screen, no progress is being made no matter how long I wait.

Any tips on how to get your brilliant setup running for bug hunting? 😅

juliushaertl commented 6 months ago

Thanks for reporting :)

I haven't tried recently but it indeed seems broken. I just pushed a small commit that should address this with bf91888

Once the images are built and published you could try again with SQL=pgsql

juliushaertl commented 6 months ago

Note there is also a pgadmin container with a web gui for accessing the postgres db

te-online commented 6 months ago

Thanks a lot for getting back and addressing the issues 😊

I've tried the latest master and indeed I can connect after starting the pgadmin container using pgadmin.local. Username postgres, password postgres, as it is specified in pgpassfile.

However, I still see ⚠ Unable to connect to the PostgreSQL server after the timeout 🤔

Does it work on your machine? Possibly my network is misconfigured, so the nextcloud.local container can't reach the postgres container.

What I also tried is to start over:

  1. re-cloning the repository, running ./bootstrap.sh
Output ```bash te-macbook:nextcloud-docker-dev2 thomas$ ./bootstrap.sh ⏩ Performing system checks ✅ docker is properly installed ✅ git is properly installed ✅ Docker is properly executable ⏩ Setup your environment in an .env file ✅ nextcloud.local (127.0.0.1) already exists ✅ nextcloud.local (::1) already exists ✅ nextcloud2.local (127.0.0.1) already exists ✅ nextcloud2.local (::1) already exists ✅ nextcloud3.local (127.0.0.1) already exists ✅ nextcloud3.local (::1) already exists ✅ stable16.local (127.0.0.1) already exists ✅ stable16.local (::1) already exists ✅ stable17.local (127.0.0.1) already exists ✅ stable17.local (::1) already exists ✅ stable18.local (127.0.0.1) already exists ✅ stable18.local (::1) already exists ✅ stable19.local (127.0.0.1) already exists ✅ stable19.local (::1) already exists ✅ stable20.local (127.0.0.1) already exists ✅ stable20.local (::1) already exists ✅ stable21.local (127.0.0.1) already exists ✅ stable21.local (::1) already exists ✅ stable22.local (127.0.0.1) already exists ✅ stable22.local (::1) already exists ✅ stable23.local (127.0.0.1) already exists ✅ stable23.local (::1) already exists ✅ stable24.local (127.0.0.1) already exists ✅ stable24.local (::1) already exists ✅ stable25.local (127.0.0.1) already exists ✅ stable25.local (::1) already exists ✅ stable26.local (127.0.0.1) already exists ✅ stable26.local (::1) already exists ✅ stable27.local (127.0.0.1) already exists ✅ stable27.local (::1) already exists ✅ stable28.local (127.0.0.1) already exists ✅ stable28.local (::1) already exists ✅ mail.local (127.0.0.1) already exists ✅ mail.local (::1) already exists ✅ collabora.local (127.0.0.1) already exists ✅ collabora.local (::1) already exists ✅ codedev.local (127.0.0.1) already exists ✅ codedev.local (::1) already exists ✅ onlyoffice.local (127.0.0.1) already exists ✅ onlyoffice.local (::1) already exists ✅ proxy.local (127.0.0.1) already exists ✅ proxy.local (::1) already exists ✅ hpb.local (127.0.0.1) already exists ✅ hpb.local (::1) already exists ✅ push.local (127.0.0.1) already exists ✅ push.local (::1) already exists ✅ keycloak.local (127.0.0.1) already exists ✅ keycloak.local (::1) already exists ✅ portal.local (127.0.0.1) already exists ✅ portal.local (::1) already exists ✅ gs1.local (127.0.0.1) already exists ✅ gs1.local (::1) already exists ✅ gs2.local (127.0.0.1) already exists ✅ gs2.local (::1) already exists ✅ lookup.local (127.0.0.1) already exists ✅ lookup.local (::1) already exists ✅ elasticsearch.local (127.0.0.1) already exists ✅ elasticsearch.local (::1) already exists ✅ elasticsearch-ui.local (127.0.0.1) already exists ✅ elasticsearch-ui.local (::1) already exists ✅ pgadmin.local (127.0.0.1) already exists ✅ pgadmin.local (::1) already exists ✅ phpmyadmin.local (127.0.0.1) already exists ✅ phpmyadmin.local (::1) already exists ✅ talk-signaling.local (127.0.0.1) already exists ✅ talk-signaling.local (::1) already exists Setting custom containers for arm platform ⏩ Setting up folder structure and fetching repositories 🌏 Fetching server (this might take a while to finish) Cloning into 'workspace/server'... remote: Enumerating objects: 11698, done. remote: Counting objects: 100% (11698/11698), done. remote: Compressing objects: 100% (9226/9226), done. remote: Total 11698 (delta 3217), reused 6206 (delta 2116), pack-reused 0 Receiving objects: 100% (11698/11698), 58.60 MiB | 16.56 MiB/s, done. Resolving deltas: 100% (3217/3217), done. Updating files: 100% (10811/10811), done. Submodule '3rdparty' (https://github.com/nextcloud/3rdparty.git) registered for path '3rdparty' Cloning into '/Users/thomas/Sites/nextcloud-docker-dev2/workspace/server/3rdparty'... remote: Enumerating objects: 52071, done. remote: Counting objects: 100% (3776/3776), done. remote: Compressing objects: 100% (1861/1861), done. remote: Total 52071 (delta 2081), reused 3466 (delta 1857), pack-reused 48295 Receiving objects: 100% (52071/52071), 70.07 MiB | 17.09 MiB/s, done. Resolving deltas: 100% (27970/27970), done. Submodule path '3rdparty': checked out 'a71bd8af76fdcfad78c865d1c60f6dde6e24f1dd' ./bootstrap.sh: line 158: APPS_CLONE_PARAMS[@]: unbound variable 🌏 Fetching viewer ❌ Failed to install viewer ./bootstrap.sh: line 158: APPS_CLONE_PARAMS[@]: unbound variable 🌏 Fetching recommendations ❌ Failed to install recommendations ./bootstrap.sh: line 158: APPS_CLONE_PARAMS[@]: unbound variable 🌏 Fetching files_pdfviewer ❌ Failed to install files_pdfviewer ./bootstrap.sh: line 158: APPS_CLONE_PARAMS[@]: unbound variable 🌏 Fetching profiler ❌ Failed to install profiler ./bootstrap.sh: line 158: APPS_CLONE_PARAMS[@]: unbound variable 🌏 Fetching hmr_enabler ❌ Failed to install hmr_enabler ./bootstrap.sh: line 158: APPS_CLONE_PARAMS[@]: unbound variable 🌏 Fetching circles ❌ Failed to install circles ╔═════════════════════════════════════════╗ ║ oOo Ready to start developing 🎉 ║ ╚═════════════════════════════════════════╝ 🚀 Start the Nextcloud server by running $ docker compose up -d nextcloud 💤 Stop it with $ docker compose stop nextcloud 🗑 Fresh install and wipe all data $ docker compose down -v Note that for performance reasons the server repository has been cloned with --depth=1. To get the full history it is highly recommended to run: $ cd workspace/server $ git fetch --unshallow $ git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" $ git fetch origin This may take some time depending on your internet connection speed. You might as well use the script in scripts/download-full-history.sh. For more details about the individual setup options see the README.md file or checkout the repo at https://github.com/juliushaertl/nextcloud-docker-dev ```
  1. Change line 11 in .env to SQL=pgsql
  2. Run docker compose up -d nextcloud pgadmin

Then I get the "Waiting for other containers" and "Unable to connect..." 😿

juliushaertl commented 6 months ago

The containers use an internal network so I don't expect that to be an issue.

I think the bootstrap command might not pull the latest image so maybe you need to walk through https://juliushaertl.github.io/nextcloud-docker-dev/basics/update/

Otherwise the old already downloaded image would still be used.

te-online commented 6 months ago

Yes, it worked! I was thinking that I read about pulling images, but then forgot about it. Thanks for your help 😊

juliushaertl commented 6 months ago

Great to hear that :)