Running Concourse on Portainer - docker

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

Related

Error: connection to server on socket "/tmp/.s.PGSQL.5432" failed

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.

Hyperledger - container_linux.go:349 starting container process caused "no such file or directory": unknown

I have installed Hyperledger Fabric (2.0.0-alpha) in Docker (2.2.0.5) running on Windows (Linux containers) and am trying to start the first-network example. When running the command ./byfn.sh -m up I am getting the following error:
OCI runtime exec failed: exec failed: container_linux.go:349: starting container process caused
"no such file or directory": unknown ERROR !!!! Test failed
From the Docker Dashboard, cli and peers have started, instead of orderer. When checking the logs of the orderer I see the following error:
2020-05-04 20:29:04.492 UTC [orderer.common.cluster] loadVerifier -> ERRO 003 Channel byfn-sys-channel has no blocks, skipping it
2020-05-04 20:29:04.500 UTC [orderer.common.cluster] loadVerifier -> INFO 004 Loaded verifier for channel testchainid from config block at index 0
2020-05-04 20:29:04.520 UTC [orderer.common.server] initializeServerConfig -> INFO 005 Starting orderer with TLS enabled
2020-05-04 20:29:04.521 UTC [orderer.common.server] initializeMultichannelRegistrar -> INFO 006 Not bootstrapping because of existing chains
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0xe06ad9]
goroutine 1 [running]:
github.com/hyperledger/fabric/protoutil.GetMetadataFromBlock(0x0, 0x1, 0x0, 0x194, 0x1dad440)
/go/src/github.com/hyperledger/fabric/protoutil/blockutils.go:110 +0x39
github.com/hyperledger/fabric/protoutil.GetLastConfigIndexFromBlock(0x0, 0xc0002f22a0, 0xffffffffffffffff, 0x0)
/go/src/github.com/hyperledger/fabric/protoutil/blockutils.go:130 +0x37
github.com/hyperledger/fabric/orderer/common/multichannel.ConfigBlock(0x7f12cf76eda8, 0xc0002f22a0, 0x7f12cf76eda8)
/go/src/github.com/hyperledger/fabric/orderer/common/multichannel/registrar.go:111 +0x68
github.com/hyperledger/fabric/orderer/common/multichannel.configTx(0x7f12cf76eda8, 0xc0002f22a0, 0xc0002f22a0)
/go/src/github.com/hyperledger/fabric/orderer/common/multichannel/registrar.go:124 +0x35
I've checked for solutions online but no results till now.
Similar question 1 - he does not explain if he installed a new Docker version or did anything else differently.
Similar question 2 - in docker-compose.yml my working_dir for orderer.example.com is /opt/gopath/src/github.com/hyperledger/fabric/orderer and for cli /opt/gopath/src/github.com/hyperledger/fabric/peer
Also, my GO version is go1.8.7
I solved the issue following a few steps:
My scripts were not working well. so I opened file script.sh and utils.sh with notepad++ and set the EOL Conversion to Linux. After this I got the following error:
Error: failed to create deliver client for orderer: orderer client
failed to connect to orderer.example.com:7050: failed to create new
connection: connection error: desc = "transport: error while dialing:
dial tcp: lookup orderer.example.com on 127.0.0.11:53: no such host"
!!!!!!!!!!!!!!! Channel creation failed !!!!!!!!!!!!!!!!
I also cleared all unused images with the following docker rm -f $(docker ps -aq)
Bringing down the network ./byfn.sh down and then start it again solved the issue.

Service "postgis" fails to start in GitLab CI

I am trying to use the Docker image "postgis/postgis:latest" as a service in GitLab CI but the service fails to start.
This is the start of the CI log, the last line is most important:
Running with gitlab-runner 12.9.0 (4c96e5ad)
on xxxxxxx xxxxxxxx
Preparing the "docker" executor
Using Docker executor with image node:lts-stretch ...
Starting service redis:latest ...
Pulling docker image redis:latest ...
Using docker image sha256:4cdbec704e477aab9d249262e60b9a8a25cbef48f0ff23ac5eae879a98a7ebd0 for redis:latest ...
Starting service postgis/postgis:latest ...
Pulling docker image postgis/postgis:latest ...
Using docker image sha256:a412dcb70af7acfbe875faea4467a1594e7cba3dfca19e5e1c6bcf35286380df for postgis/postgis:latest ...
Waiting for services to be up and running...
*** WARNING: Service runner-xxxxxxxx-project-1-concurrent-0-postgis__postgis-1 probably didn't start properly.
Health check error:
service "runner-xxxxxxxx-project-1-concurrent-0-postgis__postgis-1-wait-for-service" timeout
Health check container logs:
Service container logs:
2020-04-06T11:58:09.487216183Z The files belonging to this database system will be owned by user "postgres".
2020-04-06T11:58:09.487254326Z This user must also own the server process.
2020-04-06T11:58:09.487260023Z
2020-04-06T11:58:09.488674041Z The database cluster will be initialized with locale "en_US.utf8".
2020-04-06T11:58:09.488696993Z The default database encoding has accordingly been set to "UTF8".
2020-04-06T11:58:09.488704024Z The default text search configuration will be set to "english".
2020-04-06T11:58:09.488710330Z
2020-04-06T11:58:09.488716134Z Data page checksums are disabled.
2020-04-06T11:58:09.488721778Z
2020-04-06T11:58:09.490435786Z fixing permissions on existing directory /var/lib/postgresql/data ... ok
2020-04-06T11:58:09.490649106Z creating subdirectories ... ok
2020-04-06T11:58:09.490656485Z selecting dynamic shared memory implementation ... posix
2020-04-06T11:58:09.525841255Z selecting default max_connections ... 100
2020-04-06T11:58:09.562735034Z selecting default shared_buffers ... 128MB
2020-04-06T11:58:09.614695491Z selecting default time zone ... Etc/UTC
2020-04-06T11:58:09.616784837Z creating configuration files ... ok
2020-04-06T11:58:09.917724902Z running bootstrap script ... ok
2020-04-06T11:58:10.767115421Z performing post-bootstrap initialization ... ok
2020-04-06T11:58:10.924542026Z syncing data to disk ... ok
2020-04-06T11:58:10.924613120Z
2020-04-06T11:58:10.924659485Z initdb: warning: enabling "trust" authentication for local connections
2020-04-06T11:58:10.924720453Z You can change this by editing pg_hba.conf or using the option -A, or
2020-04-06T11:58:10.924753751Z --auth-local and --auth-host, the next time you run initdb.
2020-04-06T11:58:10.925150488Z
2020-04-06T11:58:10.925175359Z Success. You can now start the database server using:
2020-04-06T11:58:10.925182577Z
2020-04-06T11:58:10.925188661Z pg_ctl -D /var/lib/postgresql/data -l logfile start
2020-04-06T11:58:10.925195041Z
2020-04-06T11:58:10.974712774Z waiting for server to start....2020-04-06 11:58:10.974 UTC [47] LOG: starting PostgreSQL 12.2 (Debian 12.2-2.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
2020-04-06T11:58:10.976267115Z 2020-04-06 11:58:10.976 UTC [47] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2020-04-06T11:58:11.003287980Z 2020-04-06 11:58:11.002 UTC [48] LOG: database system was shut down at 2020-04-06 11:58:10 UTC
2020-04-06T11:58:11.011056242Z 2020-04-06 11:58:11.010 UTC [47] LOG: database system is ready to accept connections
2020-04-06T11:58:11.051536096Z done
2020-04-06T11:58:11.051578164Z server started
2020-04-06T11:58:11.051855017Z
2020-04-06T11:58:11.052088262Z /usr/local/bin/docker-entrypoint.sh: sourcing /docker-entrypoint-initdb.d/10_postgis.sh
2020-04-06T11:58:11.218053189Z psql: error: could not connect to server: could not translate host name "postgres" to address: Name or service not known
could not translate host name "postgres" to address: Name or service not known
It seems to me that the host "postgres" is wrong. But the documenation of GitLab says that the hostname will be the alias: https://docs.gitlab.com/ce/ci/docker/using_docker_images.html#accessing-the-services
Excerpt of my .gitlab-ci-yml:
image: node:lts-stretch
services:
- name: redis:latest
- name: postgis/postgis:latest
alias: postgres
variables:
NODE_ENV: production
REDIS_HOST: redis
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
PGHOST: postgres
PGUSER: postgres
PGPASSWORD: postgres
I have also tried to remove the alias and use "postgis-postgis" or "postgis__postgis" as the hostname as per documenation, but the same error every time. I also tried to use the docker image "mdillon/postgis" because i saw it often, but also the same error.
I tried plugging in your .gitlab-ci.yml excerpt and got an error:
This GitLab CI configuration is invalid: jobs config should contain at least one visible job
Please provide a minimal reproducible example next time. ;)
I was able to reproduce and fix the issue. The fix was to remove the PGHOST setting. (You had its value set to postgres. Your main container can get to the postgis container using the alias postgres but the postgis container itself doesn't need a hostname to get to the PostgreSQL service because that service is listening on a local socket.)
PGHOST is used by psql in the "postgis" container (launched by the services directive), in the script https://github.com/postgis/docker-postgis/blob/master/initdb-postgis.sh (which ends up in /docker-entrypoint-initdb.d/10_postgis.sh -- see https://github.com/postgis/docker-postgis/blob/master/Dockerfile.template#L16)
The following .gitlab-ci.yml works:
image: node:lts-stretch
variables:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
PGUSER: postgres
PGPASSWORD: postgres
services:
- name: postgis/postgis:latest
alias: postgres
job1:
script: ping -c 3 postgres
Here is the job log:
Running with gitlab-runner 12.9.0 (4c96e5ad)
on docker-auto-scale 0277ea0f
Preparing the "docker+machine" executor
Using Docker executor with image node:lts-stretch ...
Starting service postgis/postgis:latest ...
Pulling docker image postgis/postgis:latest ...
Using docker image sha256:a412dcb70af7acfbe875faea4467a1594e7cba3dfca19e5e1c6bcf35286380df for postgis/postgis:latest ...
Waiting for services to be up and running...
Pulling docker image node:lts-stretch ...
Using docker image sha256:88c089733a3b980b3517e8e2e8afa46b338f69d7562550cb3c2e9fd852a2fbac for node:lts-stretch ...
Preparing environment
00:05
Running on runner-0277ea0f-project-17971942-concurrent-0 via runner-0277ea0f-srm-1586221223-45d7ab06...
Getting source from Git repository
00:01
$ eval "$CI_PRE_CLONE_SCRIPT"
Fetching changes with git depth set to 50...
Initialized empty Git repository in /builds/atsaloli/service-postgis/.git/
Created fresh repository.
From https://gitlab.com/atsaloli/service-postgis
* [new ref] refs/pipelines/133464596 -> refs/pipelines/133464596
* [new branch] master -> origin/master
Checking out d20469e6 as master...
Skipping Git submodules setup
Restoring cache
00:02
Downloading artifacts
00:01
Running before_script and script
00:04
$ ping -c 3 postgres
PING postgres (172.17.0.3) 56(84) bytes of data.
64 bytes from postgis-postgis (172.17.0.3): icmp_seq=1 ttl=64 time=0.077 ms
64 bytes from postgis-postgis (172.17.0.3): icmp_seq=2 ttl=64 time=0.064 ms
64 bytes from postgis-postgis (172.17.0.3): icmp_seq=3 ttl=64 time=0.060 ms
--- postgres ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2062ms
rtt min/avg/max/mdev = 0.060/0.067/0.077/0.007 ms
Running after_script
00:01
Saving cache
00:02
Uploading artifacts for successful job
00:01
Job succeeded
As you can see in the ping command above, the container created from the image node:lts-stretch is able to access the postgis container using the postgres alias.
Does that unblock you?

docker run does absolutely nothing, no log created

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=#

Error running MongoDb on MacOSX

I am trying to run mongo with rails i get the following Error
Harshas-MacBook-Pro:~ harshamv$ mongo
MongoDB shell version: 2.6.1
connecting to: test
2014-06-14T12:07:46.356+0530 warning: Failed to connect to 127.0.0.1:27017, reason: errno:61 Connection refused
2014-06-14T12:07:46.357+0530 Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed at src/mongo/shell/mongo.js:146
exception: connect failed
When i try to repair MongoDB
Harshas-MacBook-Pro:nomad harshamv$ mongod --repair
2014-06-14T11:06:52.964+0530 [initandlisten] MongoDB starting : pid=5504 port=27017 dbpath=/data/db 64-bit host=Harshas-MacBook-Pro.local
2014-06-14T11:06:52.964+0530 [initandlisten]
2014-06-14T11:06:52.964+0530 [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000
2014-06-14T11:06:52.964+0530 [initandlisten] db version v2.6.1
2014-06-14T11:06:52.964+0530 [initandlisten] git version: nogitversion
2014-06-14T11:06:52.964+0530 [initandlisten] build info: Darwin minimavericks.local 13.1.0 Darwin Kernel Version 13.1.0: Wed Apr 2 23:52:02 PDT 2014; root:xnu-2422.92.1~2/RELEASE_X86_64 x86_64 BOOST_LIB_VERSION=1_49
2014-06-14T11:06:52.964+0530 [initandlisten] allocator: tcmalloc
2014-06-14T11:06:52.964+0530 [initandlisten] options: { repair: true }
2014-06-14T11:06:52.964+0530 [initandlisten] exception in initAndListen: 10309 Unable to create/open lock file: /data/db/mongod.lock errno:13 Permission denied Is a mongod instance already running?, terminating
2014-06-14T11:06:52.964+0530 [initandlisten] dbexit:
2014-06-14T11:06:52.964+0530 [initandlisten] shutdown: going to close listening sockets...
2014-06-14T11:06:52.964+0530 [initandlisten] shutdown: going to flush diaglog...
2014-06-14T11:06:52.964+0530 [initandlisten] shutdown: going to close sockets...
2014-06-14T11:06:52.964+0530 [initandlisten] shutdown: waiting for fs preallocator...
2014-06-14T11:06:52.964+0530 [initandlisten] shutdown: closing all files...
2014-06-14T11:06:52.964+0530 [initandlisten] closeAllFiles() finished
2014-06-14T11:06:52.964+0530 [initandlisten] shutdown: removing fs lock...
2014-06-14T11:06:52.964+0530 [initandlisten] couldn't remove fs lock errno:9 Bad file descriptor
2014-06-14T11:06:52.964+0530 [initandlisten] dbexit: really exiting now
This is the Error i get when i am trying to run my Rails app
Moped::Errors::ConnectionFailure in VenuesController#index
Could not connect to a primary node for replica set #<Moped::Cluster:70100620147140 #seeds=[<Moped::Node resolved_address="127.0.0.1:27017">]>
Error Unable to create/open lock file can be caused by these three things:
MongoDB process is running and is un-responsive
Your previous MongoDB process didn't shutdown cleanly.
You don't have write permissions on that folder / file.
Case 1:
You need to check if mongod process is active. In your terminal console, enter:
ps aux | grep mongod
If you can see a process you can kill it with:
kill $(pidof mongod)
or kill -2 $(pidof mongod)
Use -9 option only as a last resort.
You will also need to remove the old mongod.lock file and then start mongod.
Case 2:
If there wasn't an active process, then MongoDB didn't shut down cleanly.
You just need to remove mongod.lock file and then then start mongod.
Case 3:
If you removed the mongod.lock file and you're getting the same error, you should check the permissions on your dbpath folder (/data/db/). This can happen if you started mongod with sudo.
Your user or mongod should be the owner of the folder. You can change it with:
chown -R $(id -u) /data/db
Another process/instance of mongodb is running in background, so terminate it first. Even if no such process is running, you need to go to where your mongodb data directory is and clear the content in a file that has the end extension in its name .lock (mongod.lock). Only then you will be able to run mongodb properly.
Steps to terminate a process:
Browse to the location /Applications/Utilities and double click on 'Terminal'.
Run ps aux | grep mongo.
Then run kill -9 <PROCESS-ID> for process number you get in the first line (I believe there would be two lines in total unless more processes with similar names are running. )

Resources