I am attempting to run the following docker container:
https://hub.docker.com/r/bgruening/pubmedportable/
I am doing so using the following command:
sudo docker run -d -v /home/$USER/docker_pubmedportable/:/export/ -p 9999:5432 bgruening/pubmedportable
The only output I get is immediately returned:
9b76caddaddbe262bf30d3edbab30da9fa29b9e5f1ad3a4148e753f4e5e929bd
And that is all that is done. There should be a postgres server that is instantiated/created, filled with data, and then hosted at the port 9999 on localhost.
I tried looking at the logs via:
docker logs -f 9b76caddaddbe262bf30d3edbab30da9fa29b9e5f1ad3a4148e753f4e5e929bd
However, this also returns no information.
Also, running docker ps provides absolutely nothing after the commands are issued.
It is my understanding that docker containers are supposed to "just work" on any platform, with little to no effort required.
However, this docker container has not been able to create and host this database and does not appear to be running at all.
Is there a method to determine which section of the docker container is causing a problem?
The OS is archlinux.
Probably some error is making the container exits.
Run it without the -d option, so you can see the log.
I was able to bring up the container with your command. I adapted the path to my environment.
..[$] <()> docker run -d -v ${pwd}:/export/ -p 9999:5432 bgruening/pubmedportable
1d21b00a5fdd376016bb09aeb472a295b86f74aea385a609ca8b33a0ba87f306
..[$] <()> docker logs 1d21b00a5fdd376016bb09aeb472a295b86f74aea385a609ca8b33a0ba87f306
Starting PostgreSQL 9.1 database server: main.
Initialized with 4 processes
######################
###### Finished ######
######################
programme started - Sat Sep 15 04:47:35 2018
programme ended - Sat Sep 15 04:47:36 2018
/usr/local/lib/python2.7/dist-packages/sqlalchemy/sql/elements.py:3779: SAWarning: Textual SQL expression '\n SELECT \n ...' should be explicitly declared as text('\n SELECT \n ...') (this warning may be suppressed after 10 occurrences)
{"expr": util.ellipses_string(element)})
-------------
processing files from year 1809 to 2016
-------------
got articles from PostgreSQL database
-------------
now indexing articles in Xapian
-------------
no search of synonyms performed, use "python RunXapian.py -h" for parameter view
2017-06-01 00:50:17 UTC LOG: aborting any active transactions
2017-06-01 00:50:17 UTC LOG: autovacuum launcher shutting down
2017-06-01 00:50:17 UTC LOG: shutting down
2017-06-01 00:50:17 UTC LOG: database system is shut down
2018-09-15 04:47:34 UTC LOG: database system was shut down at 2017-06-01 00:50:17 UTC
2018-09-15 04:47:34 UTC LOG: database system is ready to accept connections
2018-09-15 04:47:34 UTC LOG: autovacuum launcher started
2018-09-15 04:47:34 UTC LOG: incomplete startup packet
2018-09-15 04:47:36 UTC LOG: could not receive data from client: Connection reset by peer
2018-09-15 04:47:36 UTC LOG: unexpected EOF on client connection
..[$] <()> psql -h localhost -p 9999 -U parser pubmed
Password for user parser:
psql (10.5, server 9.1.24)
SSL connection (protocol: TLSv1.2, cipher: DHE-RSA-AES256-GCM-SHA384, bits: 256, compression: on)
Type "help" for help.
pubmed=#
Related
I seem to be having trouble starting concourse on Portainer using the stacks section. I have attached all of the relevant files below but I feel like I am missing something. I know there might be a way to start this using the command line but I am looking for a simple solution that is just a compose file if possible. This way when I teach this to others later the process for setup is easier.
I have the following compose file that concourse provided:
version: '3'
services:
concourse-db:
image: postgres
restart: unless-stopped
environment:
POSTGRES_DB: concourse
POSTGRES_PASSWORD: concourse_pass
POSTGRES_USER: concourse_user
PGDATA: /database
concourse:
image: concourse/concourse
restart: unless-stopped
command: quickstart
privileged: true
depends_on: [concourse-db]
ports: ["8080:8080"]
expose:
- "8080"
environment:
CONCOURSE_POSTGRES_HOST: concourse-db
CONCOURSE_POSTGRES_USER: concourse_user
CONCOURSE_POSTGRES_PASSWORD: concourse_pass
CONCOURSE_POSTGRES_DATABASE: concourse
CONCOURSE_EXTERNAL_URL: http://localhost:8080
CONCOURSE_ADD_LOCAL_USER: test:test
CONCOURSE_MAIN_TEAM_LOCAL_USER: test
# instead of relying on the default "detect"
CONCOURSE_WORKER_BAGGAGECLAIM_DRIVER: overlay
CONCOURSE_CLIENT_SECRET: Y29uY291cnNlLXdlYgo=
CONCOURSE_TSA_CLIENT_SECRET: Y29uY291cnNlLXdvcmtlcgo=
CONCOURSE_X_FRAME_OPTIONS: allow
CONCOURSE_CONTENT_SECURITY_POLICY: "*"
CONCOURSE_CLUSTER_NAME: tutorial
CONCOURSE_WORKER_CONTAINERD_DNS_SERVER: "8.8.8.8"
CONCOURSE_WORKER_RUNTIME: "containerd"
I am getting errors on both the web and the database. Here are the outputs:
{"timestamp":"2022-03-23T14:57:06.947153851Z","level":"info","source":"worker","message":"worker.beacon-runner.beacon.signal.signalled","data":{"session":"4.1.6"}}
{"timestamp":"2022-03-23T14:57:06.947202860Z","level":"info","source":"worker","message":"worker.beacon-runner.logging-runner-exited","data":{"session":"12"}}
{"timestamp":"2022-03-23T14:57:06.947240334Z","level":"error","source":"quickstart","message":"quickstart.worker-runner.logging-runner-exited","data":{"error":"Exit trace for group:\ngarden exited with error: Exit trace for group:\ncontainerd-garden-backend exited with error: setup host network failed: error appending iptables rule: running [/sbin/iptables -t filter -A INPUT -i concourse0 -j REJECT --reject-with icmp-host-prohibited --wait]: exit status 1: iptables: No chain/target/match by that name.\n\ncontainerd exited with nil\n\ncontainer-sweeper exited with nil\nvolume-sweeper exited with nil\ndebug exited with nil\nbaggageclaim exited with nil\nhealthcheck exited with nil\nbeacon exited with nil\n","session":"2"}}
{"timestamp":"2022-03-23T14:57:06.947348599Z","level":"info","source":"web","message":"web.tsa-runner.logging-runner-exited","data":{"session":"2"}}
{"timestamp":"2022-03-23T14:57:06.947457476Z","level":"info","source":"atc","message":"atc.tracker.drain.start","data":{"session":"26.1"}}
{"timestamp":"2022-03-23T14:57:06.947657430Z","level":"info","source":"atc","message":"atc.tracker.drain.waiting","data":{"session":"26.1"}}
{"timestamp":"2022-03-23T14:57:06.947670921Z","level":"info","source":"atc","message":"atc.tracker.drain.done","data":{"session":"26.1"}}
{"timestamp":"2022-03-23T14:57:06.949573381Z","level":"info","source":"web","message":"web.atc-runner.logging-runner-exited","data":{"session":"1"}}
{"timestamp":"2022-03-23T14:57:06.950178927Z","level":"info","source":"quickstart","message":"quickstart.web-runner.logging-runner-exited","data":{"session":"1"}}
error: Exit trace for group:
worker exited with error: Exit trace for group:
garden exited with error: Exit trace for group:
containerd-garden-backend exited with error: setup host network failed: error appending iptables rule: running [/sbin/iptables -t filter -A INPUT -i concourse0 -j REJECT --reject-with icmp-host-prohibited --wait]: exit status 1: iptables: No chain/target/match by that name.
containerd exited with nil
container-sweeper exited with nil
volume-sweeper exited with nil
debug exited with nil
baggageclaim exited with nil
healthcheck exited with nil
beacon exited with nil
and the output for the db
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".
Data page checksums are disabled.
fixing permissions on existing directory /database ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... Etc/UTC
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok
Success. You can now start the database server using:
pg_ctl -D /database -l logfile start
initdb: warning: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.
waiting for server to start....2022-03-23 14:35:37.062 UTC [50] LOG: starting PostgreSQL 14.2 (Debian 14.2-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
2022-03-23 14:35:37.144 UTC [50] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2022-03-23 14:35:37.539 UTC [51] LOG: database system was shut down at 2022-03-23 14:35:35 UTC
2022-03-23 14:35:37.617 UTC [50] LOG: database system is ready to accept connections
done
server started
CREATE DATABASE
/usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
waiting for server to shut down...2022-03-23 14:35:40.541 UTC [50] LOG: received fast shutdown request
.2022-03-23 14:35:40.562 UTC [50] LOG: aborting any active transactions
2022-03-23 14:35:40.565 UTC [50] LOG: background worker "logical replication launcher" (PID 57) exited with exit code 1
2022-03-23 14:35:40.566 UTC [52] LOG: shutting down
2022-03-23 14:35:40.829 UTC [50] LOG: database system is shut down
done
server stopped
PostgreSQL init process complete; ready for start up.
2022-03-23 14:35:40.961 UTC [1] LOG: starting PostgreSQL 14.2 (Debian 14.2-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
2022-03-23 14:35:40.961 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
2022-03-23 14:35:40.961 UTC [1] LOG: listening on IPv6 address "::", port 5432
2022-03-23 14:35:41.012 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2022-03-23 14:35:41.065 UTC [64] LOG: database system was shut down at 2022-03-23 14:35:40 UTC
2022-03-23 14:35:41.108 UTC [1] LOG: database system is ready to accept connections
2022-03-23 14:57:46.294 UTC [1] LOG: received fast shutdown request
2022-03-23 14:57:46.317 UTC [1] LOG: aborting any active transactions
2022-03-23 14:57:46.319 UTC [1] LOG: background worker "logical replication launcher" (PID 70) exited with exit code 1
2022-03-23 14:57:46.319 UTC [65] LOG: shutting down
I'm using the test-network from the hyperledger fabric samples at LTS version 2.2.3. I bring up the network with ./network.sh up createChannel -s couchdb followed by the command for adding the third org in the addOrg3 folder: ./addOrg3.sh up -c mychannel -s couchdb. Sometimes I want to have a fresh start when working on a smart contract so I bring down the network with ./network.sh down. Then when I restart the network with the previously mentioned commands sometimes one of the peer nodes will just fail to start. The log just shows this:
2022-02-18 13:10:25.087 UTC [nodeCmd] serve -> INFO 001 Starting peer:
Version: 2.2.3
Commit SHA: 94ace65
Go version: go1.15.7
OS/Arch: linux/amd64
Chaincode:
Base Docker Label: org.hyperledger.fabric
Docker Namespace: hyperledger
2022-02-18 13:10:25.087 UTC [peer] getLocalAddress -> INFO 002 Auto-detected peer address: 172.18.0.9:11051
2022-02-18 13:10:25.088 UTC [peer] getLocalAddress -> INFO 003 Returning peer0.org3.example.com:11051
I tried connecting to the container and attach to the process peer node start which is the process that brings up the container to get some more info on why its hanging. But since it is the init process with pid 1 one neither attach to it nor kill it. Also killing the container is not working as it is just not responding so I need to kill the whole docker engine. I tried the following without success: Purging docker with docker system prune -a --volumes, restarting my computer, re-downloading the fabric folder and binaries. Still the same error occurs. How is this possible, which information is still on my machine that makes it fail? At least I assume there is something on my machine as the same freshly downloaded code works on another machine and after many times repeating the pruring and restarting and redownloading it also works again on my computer.
I'm kind of hitting my head against the wall trying to figure this out...
When I run psql in my terminal, it gives me:
psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: Connection refused
Is the server running locally and accepting connections on that socket?
I see the service running with brew services, but another one appears because I tried to upgrade PSQL as well, but that might've messed it up even more.
postgresql started fella /Users/fella/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
postgresql#13 stopped
I've tried:
pg_ctl -D /usr/local/var/postgres stop -s -m fast
output >> pg_ctl: PID file "/usr/local/var/postgres/postmaster.pid" does not exist Is server running?
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
output >> waiting for server to start.... stopped waiting pg_ctl: could not start server Examine the log output.
I tried:
brew update
brew upgrade
which went without any errors, but I still get the same error when I run psql
I just ran
➜ ~ code /usr/local/opt/postgresql/homebrew.mxcl.postgresql.plist
➜ ~ tail -n 100 /usr/local/var/log/postgres.log
And found a whole bunch of errors there. Lots of this happening:
incompatible with server 2021-10-24 18:04:41.848 MDT [1038] DETAIL:
The data directory was initialized by PostgreSQL version 13, which is
not compatible with this version 14.0.
But this was the most recent one:
2021-10-24 18:09:45.680 MDT [4129] LOG: starting PostgreSQL 14.0
on x86_64-apple-darwin20.6.0, compiled by Apple clang version 13.0.0
(clang-1300.0.29.3), 64-bit 2021-10-24 18:09:45.682 MDT [4129] LOG:
listening on IPv6 address "::1", port 5432 2021-10-24 18:09:45.682 MDT
[4129] LOG: listening on IPv4 address "127.0.0.1", port 5432
2021-10-24 18:09:45.763 MDT [4129] LOG: listening on Unix socket
"/tmp/.s.PGSQL.5432" 2021-10-24 18:09:45.814 MDT [4129] LOG: could
not open directory "pg_tblspc": No such file or directory 2021-10-24
18:09:45.815 MDT [4129] LOG: could not open configuration file
"/usr/local/var/postgres/pg_hba.conf": No such file or directory
2021-10-24 18:09:45.816 MDT [4129] FATAL: could not load pg_hba.conf
2021-10-24 18:09:45.818 MDT [4129] LOG: database system is shut down
postgres: could not access the server configuration file
"/usr/local/var/postgres/postgresql.conf": No such file or directory
postgres: could not access the server configuration file
"/usr/local/var/postgres/postgresql.conf": No such file or directory
postgres: could not access the server configuration file
"/usr/local/var/postgres/postgresql.conf": No such file or
directory
I worked with one of the instructors at my bootcamp to resolve this - we found that I had two instance of PSQL on my PC. We dug into the root folder and removed the older version 13 and re-ran the installation which solved all my issues.
I was changing my development environment from an old XAMPP installation to a new dockerized solution (OS: Ubuntu Mate LTS 18.03). It seems everything is running fine, but I still don’t get a connection from the Apache2 docker image to my Postgres DBMS docker image. :-/
I use the official postgres docker image with the Postgres 10.3 Server. The Database is up and I can connect via my NetBeans 11 IDE, also via the PgAdmin tool and a local running JavaEE Tomcat Server. The Server also accept connections outside of localhost. The command to initiate the postgres image was:
docker run -d -p 5432:5432 --name postgres -v /media/veracrypt1/Applications/docker/postgreSQL:/var/lib/postgresql/data postgres
As Apache /PHP image I use also the official php7.3-apache from DockerHub. The Image I instantiated by:
docker run -d -p 80:80 --name php-7.3 -v /media/veracrypt1/htdocs:/var/www/html -v /media/veracrypt1/Applications/docker/php-7.3/apache:/etc/apache2 -v /media/veracrypt1/Applications/docker/php-7.3/php:/usr/local/etc/php php:7.3-apache
The PHP scripts also get well executed.
Then I find out with the php_info() the Apache image do not contain the postgres pdo extension. I added the extensions inside the docker image by a solution I had find on google:
apt-get install -y libpq-dev \
&& docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql \
&& docker-php-ext-install pdo pdo_pgsql pgsql
After this procedure the postgres PDO extension appear in the php_info() and by the command \PDO::getAvailableDrivers(). But when I try to connect I still get a server timeout:
[ERROR] DBMS Connection SQLSTATE[08006] [7] timeout expired
As Driver output is got this information: available Drivers: array(2) { [0]=> string(6) "sqlite" 2=> string(5) "pgsql" }
My php snippet seems also fine:
$dsn = sprintf("pgsql:host=%s;port=%d;dbname=%s;user=%s;password=%s",
$params[$this->host],
$params[$this->port],
$params[$this->schemata],
$params[$this->user],
$params[$this->password]);
$ dbh = new \PDO($dsn $this->user, $this->password);
$dbh->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
$dbh->setAttribute(\PDO::ATTR_TIMEOUT, 10);
$pdo = $dbh->query($sql);
The database table is available and the SELECT statement works fine inside the NetBeans IDE.
It looks that there is an issue with the php7.3-apache image. I guess my way to activate the extension is not proper. If someone could help me to get the DBMS connection would be great. Thanks a lot in advanced.
EDIT: The full POD Connection string is:
pgsql:host=172.17.0.1;port=5432;dbname=tinycms;user=tinycms;password=tinycms
Database User etc is correct, because I us this in my Netbeans IDE to connect to postgres.
CMD of the postgres docker container (including the execution of the PHP script:
jean#jean-ThinkPad-T540p:~$ docker start -a postgres
2019-07-13 16:19:20.680 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
2019-07-13 16:19:20.680 UTC [1] LOG: listening on IPv6 address "::", port 5432
2019-07-13 16:19:20.848 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2019-07-13 16:19:21.446 UTC [26] LOG: database system was shut down at
2019-07-13 16:18:45 UTC
2019-07-13 16:19:21.637 UTC [1] LOG: database system is ready to accept connections
In shell I typed bin/dev page foo and shell returned Node is not running, I checked my logs and noticed the message epmd: epmd: node name already occupied nitrogen
Then, in shell I typed epmd -names and it returned
epmd: up and running on port 4369 with data:
name nitrogen at port 61109
Running epmd -debug gives
epmd: Thu Jun 27 01:01:52 2013: epmd running - daemon = 0
epmd: Thu Jun 27 01:01:52 2013: there is already a epmd running at port 4369
I cannot stop the node, and when I try apparently it is active in the db
epmd: local epmd responded with <>
Killing not allowed - living nodes in database.
In Eshell, I received the following
=ERROR REPORT==== 27-Jun-2013::00:49:53 ===
** Connection attempt from disallowed node 'nitrogen_maint_19141#127.0.0.1' **
Is there a method to get Eshell to recognize this node, in order to run bin/dev function?
I've noticed you posting on the Nitrogen mailing list, and as I understand it, you've got it straightened out, but in this situation, I'd kill the running node manually with a ps aux | grep nitrogen, then kill the process it finds with a simple kill XYZ.
That, or, I've seen the "Node is not running" thing pop up when the process was launched with a different user, such that you don't have access to the erlang pipe.
Admittedly, my advice isn't terribly scientific (killing a process is pretty nasty), but it's a simple solution if for whatever reason something got hosed during launching and you're unable to attach to the node.