[GH-ISSUE #233] [AMQP] Error: getaddrinfo EAI_AGAIN localhost localhost:5672 #129

Closed
opened 2026-02-26 09:36:44 +03:00 by kerem · 13 comments
Owner

Originally created by @icksky on GitHub (Mar 17, 2020).
Original GitHub issue: https://github.com/ONLYOFFICE/Docker-DocumentServer/issues/233

Do you want to request a feature or report a bug?
BUG

What is the current behavior?
I think it's the dns problem. But the other images have not this problem.

  1. I start the container, then get follows error.
 * Starting PostgreSQL 10 database server
 * Error: /usr/lib/postgresql/10/bin/pg_ctl /usr/lib/postgresql/10/bin/pg_ctl start -D /var/lib/postgresql/10/main -l /var/log/postgresql/postgresql-10-main.log -s -o  -c config_file="/etc/postgresql/10/main/postgresql.conf"  exited with status 1:
2020-03-17 11:16:02.056 CST [136] LOG:  could not translate host name "localhost", service "5432" to address: Temporary failure in name resolution
2020-03-17 11:16:02.062 CST [136] WARNING:  could not create listen socket for "localhost"
2020-03-17 11:16:02.062 CST [136] FATAL:  could not create any TCP/IP sockets
2020-03-17 11:16:02.062 CST [136] LOG:  database system is shut down
pg_ctl: could not start server
Examine the log output.
   ...fail!
 * Starting RabbitMQ Messaging Server rabbitmq-server
   ...done.
Starting redis-server: redis-server.
Waiting for connection to the localhost host on port 5432

I can fix this by modify /etc/postgresql/10/main/postgresql.conf. Change listen_addresses = localhost to listen_addresses = '*'

  1. after do this, I restart container and get follows error.
 * Starting PostgreSQL 10 database server
   ...done.
 * Starting RabbitMQ Messaging Server rabbitmq-server
   ...done.
Starting redis-server: redis-server.
Starting supervisor: supervisord.
 * Starting periodic command scheduler cron
   ...done.
 * Starting nginx nginx
   ...done.
Generating AllFonts.js, please wait...Done
Generating presentation themes, please wait...Done
ds:docservice: stopped
ds:docservice: started
ds:converter: stopped
ds:converter: started
 * Reloading nginx configuration nginx
   ...done.
==> /var/log/onlyoffice/documentserver/converter/err.log <==

==> /var/log/onlyoffice/documentserver/converter/out.log <==
[2020-03-17T05:38:43.322] [ERROR] nodeJS - [AMQP] Error: getaddrinfo EAI_AGAIN localhost localhost:5672
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:26)
[2020-03-17T05:38:44.323] [ERROR] nodeJS - [AMQP] Error: getaddrinfo EAI_AGAIN localhost localhost:5672
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:26)

==> /var/log/onlyoffice/documentserver/docservice/err.log <==

==> /var/log/onlyoffice/documentserver/docservice/out.log <==
[2020-03-17T05:38:43.619] [ERROR] nodeJS - [AMQP] Error: getaddrinfo EAI_AGAIN localhost localhost:5672
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:26)
[2020-03-17T05:38:44.621] [ERROR] nodeJS - [AMQP] Error: getaddrinfo EAI_AGAIN localhost localhost:5672
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:26)

==> /var/log/onlyoffice/documentserver/metrics/err.log <==

==> /var/log/onlyoffice/documentserver/metrics/out.log <==
17 Mar 05:38:05 - [801] reading config file: ./config/config.js
17 Mar 05:38:05 - server is up INFO

==> /var/log/onlyoffice/documentserver/nginx.error.log <==

==> /var/log/onlyoffice/documentserver/spellchecker/err.log <==

==> /var/log/onlyoffice/documentserver/spellchecker/out.log <==
[2020-03-17T05:38:06.145] [WARN] nodeJS - start cluster with 1 workers
[2020-03-17T05:38:06.237] [WARN] nodeJS - worker 847 started.
[2020-03-17T05:38:06.944] [WARN] nodeJS - Express server starting...
[2020-03-17T05:38:07.051] [WARN] nodeJS - Express server listening on port 8080 in production-linux mode

==> /var/log/onlyoffice/documentserver/converter/out.log <==
[2020-03-17T05:38:48.329] [ERROR] nodeJS - [AMQP] Error: getaddrinfo EAI_AGAIN localhost localhost:5672
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:26)

==> /var/log/onlyoffice/documentserver/docservice/out.log <==
[2020-03-17T05:40:52.798] [ERROR] nodeJS - [AMQP] Error: getaddrinfo EAI_AGAIN localhost localhost:5672
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:26)

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

sudo docker run -i -t -d -p 56789:80 \
    -v /app/onlyoffice/DocumentServer/logs:/var/log/onlyoffice  \
    -v /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data  onlyoffice/documentserver

Did this work in previous versions of DocumentServer?
No

DocumentServer Docker tag:
5.5.0.165

Host Operating System:
OMV4.x

Originally created by @icksky on GitHub (Mar 17, 2020). Original GitHub issue: https://github.com/ONLYOFFICE/Docker-DocumentServer/issues/233 **Do you want to request a *feature* or report a *bug*?** BUG **What is the current behavior?** I think it's the dns problem. But the other images have not this problem. 1. I start the container, then get follows error. ```shell * Starting PostgreSQL 10 database server * Error: /usr/lib/postgresql/10/bin/pg_ctl /usr/lib/postgresql/10/bin/pg_ctl start -D /var/lib/postgresql/10/main -l /var/log/postgresql/postgresql-10-main.log -s -o -c config_file="/etc/postgresql/10/main/postgresql.conf" exited with status 1: 2020-03-17 11:16:02.056 CST [136] LOG: could not translate host name "localhost", service "5432" to address: Temporary failure in name resolution 2020-03-17 11:16:02.062 CST [136] WARNING: could not create listen socket for "localhost" 2020-03-17 11:16:02.062 CST [136] FATAL: could not create any TCP/IP sockets 2020-03-17 11:16:02.062 CST [136] LOG: database system is shut down pg_ctl: could not start server Examine the log output. ...fail! * Starting RabbitMQ Messaging Server rabbitmq-server ...done. Starting redis-server: redis-server. Waiting for connection to the localhost host on port 5432 ``` > I can fix this by modify `/etc/postgresql/10/main/postgresql.conf`. Change `listen_addresses = localhost` to `listen_addresses = '*'` 2. after do this, I restart container and get follows error. ```shell * Starting PostgreSQL 10 database server ...done. * Starting RabbitMQ Messaging Server rabbitmq-server ...done. Starting redis-server: redis-server. Starting supervisor: supervisord. * Starting periodic command scheduler cron ...done. * Starting nginx nginx ...done. Generating AllFonts.js, please wait...Done Generating presentation themes, please wait...Done ds:docservice: stopped ds:docservice: started ds:converter: stopped ds:converter: started * Reloading nginx configuration nginx ...done. ==> /var/log/onlyoffice/documentserver/converter/err.log <== ==> /var/log/onlyoffice/documentserver/converter/out.log <== [2020-03-17T05:38:43.322] [ERROR] nodeJS - [AMQP] Error: getaddrinfo EAI_AGAIN localhost localhost:5672 at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:26) [2020-03-17T05:38:44.323] [ERROR] nodeJS - [AMQP] Error: getaddrinfo EAI_AGAIN localhost localhost:5672 at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:26) ==> /var/log/onlyoffice/documentserver/docservice/err.log <== ==> /var/log/onlyoffice/documentserver/docservice/out.log <== [2020-03-17T05:38:43.619] [ERROR] nodeJS - [AMQP] Error: getaddrinfo EAI_AGAIN localhost localhost:5672 at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:26) [2020-03-17T05:38:44.621] [ERROR] nodeJS - [AMQP] Error: getaddrinfo EAI_AGAIN localhost localhost:5672 at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:26) ==> /var/log/onlyoffice/documentserver/metrics/err.log <== ==> /var/log/onlyoffice/documentserver/metrics/out.log <== 17 Mar 05:38:05 - [801] reading config file: ./config/config.js 17 Mar 05:38:05 - server is up INFO ==> /var/log/onlyoffice/documentserver/nginx.error.log <== ==> /var/log/onlyoffice/documentserver/spellchecker/err.log <== ==> /var/log/onlyoffice/documentserver/spellchecker/out.log <== [2020-03-17T05:38:06.145] [WARN] nodeJS - start cluster with 1 workers [2020-03-17T05:38:06.237] [WARN] nodeJS - worker 847 started. [2020-03-17T05:38:06.944] [WARN] nodeJS - Express server starting... [2020-03-17T05:38:07.051] [WARN] nodeJS - Express server listening on port 8080 in production-linux mode ==> /var/log/onlyoffice/documentserver/converter/out.log <== [2020-03-17T05:38:48.329] [ERROR] nodeJS - [AMQP] Error: getaddrinfo EAI_AGAIN localhost localhost:5672 at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:26) ==> /var/log/onlyoffice/documentserver/docservice/out.log <== [2020-03-17T05:40:52.798] [ERROR] nodeJS - [AMQP] Error: getaddrinfo EAI_AGAIN localhost localhost:5672 at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:26) ``` **If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.** ```shell sudo docker run -i -t -d -p 56789:80 \ -v /app/onlyoffice/DocumentServer/logs:/var/log/onlyoffice \ -v /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data onlyoffice/documentserver ``` **Did this work in previous versions of DocumentServer?** No **DocumentServer Docker tag:** 5.5.0.165 **Host Operating System:** OMV4.x
kerem closed this issue 2026-02-26 09:36:45 +03:00
Author
Owner

@ShockwaveNN commented on GitHub (Mar 17, 2020):

@icksky Hi, I think this may be something to do with your OS, I have no experience with OMV.
I think there is some troubles with Docker, can you point out which exact release of OMV are you using, on thich device and I see that latest release of openmediavault is 5.3.4

<!-- gh-comment-id:599942772 --> @ShockwaveNN commented on GitHub (Mar 17, 2020): @icksky Hi, I think this may be something to do with your OS, I have no experience with OMV. I think there is some troubles with Docker, can you point out which exact release of OMV are you using, on thich device and I see that latest [release of openmediavault ](https://sourceforge.net/projects/openmediavault/files/)is 5.3.4
Author
Owner

@icksky commented on GitHub (Mar 17, 2020):

@ShockwaveNN Thanks for your reply. The v5.3.4 of OMV is a beta version. I'm using v4.1.33. I think the closest version in your link is v4.1.22.

# uname -a
Linux nas 4.15.18-26-pve #1 SMP PVE 4.15.18-54 (Sat, 15 Feb 2020 15:34:24 +0100) x86_64 GNU/Linux
# docker -v
Docker version 19.03.7, build 7141c199a2
<!-- gh-comment-id:599951384 --> @icksky commented on GitHub (Mar 17, 2020): @ShockwaveNN Thanks for your reply. The v5.3.4 of OMV is a beta version. I'm using v4.1.33. I think the closest version in your link is v4.1.22. ```shell # uname -a Linux nas 4.15.18-26-pve #1 SMP PVE 4.15.18-54 (Sat, 15 Feb 2020 15:34:24 +0100) x86_64 GNU/Linux ``` ```shell # docker -v Docker version 19.03.7, build 7141c199a2 ```
Author
Owner

@ShockwaveNN commented on GitHub (Mar 17, 2020):

@icksky But why there is no 4.1.33 at my link? My link is from official site if I understand it right? https://www.openmediavault.org/download.html

<!-- gh-comment-id:599954450 --> @ShockwaveNN commented on GitHub (Mar 17, 2020): @icksky But why there is no 4.1.33 at my link? My link is from official site if I understand it right? https://www.openmediavault.org/download.html
Author
Owner

@icksky commented on GitHub (Mar 17, 2020):

@ShockwaveNN Sorry for that. it's v4.1.35. I think you can update from 4.1.22.
image

<!-- gh-comment-id:599962023 --> @icksky commented on GitHub (Mar 17, 2020): @ShockwaveNN Sorry for that. it's v4.1.35. I think you can update from 4.1.22. ![image](https://user-images.githubusercontent.com/13565030/76840864-d954df80-6872-11ea-90c3-803a1ed8ea5d.png)
Author
Owner

@ShockwaveNN commented on GitHub (Mar 17, 2020):

@icksky Ok, I'll try to install it on my VirtualBox and reproduce your case, but if everything is fine for me I think you should contact OMV support

<!-- gh-comment-id:599962735 --> @ShockwaveNN commented on GitHub (Mar 17, 2020): @icksky Ok, I'll try to install it on my VirtualBox and reproduce your case, but if everything is fine for me I think you should contact OMV support
Author
Owner

@ShockwaveNN commented on GitHub (Mar 17, 2020):

Just installed OMV and run

sudo docker run -i -t -d -p 56789:80 \
    -v /app/onlyoffice/DocumentServer/logs:/var/log/onlyoffice  \
    -v /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data  onlyoffice/documentserver

Everything seems fine on

# docker -v
Docker version 19.03.8, build afacb8b7f0
# uname -a
Linux openmediavault 4.19.0-0.bpo.4-amd64 #1 SMP Debian 4.19.28-2~bpo9+1 (2019-03-27) x86_64 GNU/Linux

There is something strange for me in your uname entry
Does pve mean that you use some kind of custom kernel? I found this page https://pve.proxmox.com/wiki/Proxmox_VE_Kernel
Am I right?

<!-- gh-comment-id:599974199 --> @ShockwaveNN commented on GitHub (Mar 17, 2020): Just installed OMV and run ``` sudo docker run -i -t -d -p 56789:80 \ -v /app/onlyoffice/DocumentServer/logs:/var/log/onlyoffice \ -v /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data onlyoffice/documentserver ``` Everything seems fine on ``` # docker -v Docker version 19.03.8, build afacb8b7f0 # uname -a Linux openmediavault 4.19.0-0.bpo.4-amd64 #1 SMP Debian 4.19.28-2~bpo9+1 (2019-03-27) x86_64 GNU/Linux ``` There is something strange for me in your uname entry Does `pve` mean that you use some kind of custom kernel? I found this page https://pve.proxmox.com/wiki/Proxmox_VE_Kernel Am I right?
Author
Owner

@icksky commented on GitHub (Mar 17, 2020):

@ShockwaveNN Yes, you are right. I Install omv extras.
image

image

But I don't think it's the problem.

<!-- gh-comment-id:599979190 --> @icksky commented on GitHub (Mar 17, 2020): @ShockwaveNN Yes, you are right. I [Install omv extras](https://github.com/OpenMediaVault-Plugin-Developers/openmediavault-omvextrasorg/wiki/Install-omv-extras). ![image](https://user-images.githubusercontent.com/13565030/76844240-fa6bff00-6877-11ea-8a37-92c5a2c2e9f6.png) ![image](https://user-images.githubusercontent.com/13565030/76844178-e4f6d500-6877-11ea-8c02-9594a7247309.png) But I don't think it's the problem.
Author
Owner

@ShockwaveNN commented on GitHub (Mar 17, 2020):

@icksky yeap, your right
I've installed

# uname -a
Linux openmediavault 4.15.18-26-pve #1 SMP PVE 4.15.18-54 (Sat, 15 Feb 2020 15:34:24 +0100) x86_64 GNU/Linux

and docker run is fine for me

Seems there is something more with your system. I think you should try to google original postgresql could not translate host name "localhost" error and try to debug it

<!-- gh-comment-id:599989719 --> @ShockwaveNN commented on GitHub (Mar 17, 2020): @icksky yeap, your right I've installed ``` # uname -a Linux openmediavault 4.15.18-26-pve #1 SMP PVE 4.15.18-54 (Sat, 15 Feb 2020 15:34:24 +0100) x86_64 GNU/Linux ``` and docker run is fine for me Seems there is something more with your system. I think you should try to google original postgresql `could not translate host name "localhost"` error and try to debug it
Author
Owner

@icksky commented on GitHub (Mar 17, 2020):

@ShockwaveNN Thank you very much. I will try. If I find out the solution, I will share it.

<!-- gh-comment-id:599999188 --> @icksky commented on GitHub (Mar 17, 2020): @ShockwaveNN Thank you very much. I will try. If I find out the solution, I will share it.
Author
Owner

@ShockwaveNN commented on GitHub (Mar 17, 2020):

@icksky I think you can try to setup postgresql in Docker (without even touching DocumentServer) and see if postgresql itself give you could not translate host name "localhost", service "5432" to address: Temporary failure in name resolution error.
If this error happens - DocumentServer have nothing to do with your problem

<!-- gh-comment-id:600001894 --> @ShockwaveNN commented on GitHub (Mar 17, 2020): @icksky I think you can try to setup postgresql in Docker (without even touching DocumentServer) and see if postgresql itself give you `could not translate host name "localhost", service "5432" to address: Temporary failure in name resolution` error. If this error happens - DocumentServer have nothing to do with your problem
Author
Owner

@icksky commented on GitHub (Mar 18, 2020):

I can't solve it right now. I'll close this issue. Thanks again.

<!-- gh-comment-id:600495731 --> @icksky commented on GitHub (Mar 18, 2020): I can't solve it right now. I'll close this issue. Thanks again.
Author
Owner

@icksky commented on GitHub (Mar 25, 2020):

I finally solved the problem, it's because of the permission of /etc/hosts. Its permission is 600(-rw-------) and I change it to 644(-rw-r--r--).

Because of I must run the command before run document server, so I just change the docker's entrypoint, and run some command like:

/bin/bash -c 'chmod 644 /etc/hosts && ls -l /etc/hosts && /app/ds/run-document-server.sh'

@ShockwaveNN Thanks again. Hope this can help. But I don't know if this image caused this permission problem.

<!-- gh-comment-id:603892998 --> @icksky commented on GitHub (Mar 25, 2020): I finally solved the problem, it's because of the permission of /etc/hosts. Its permission is 600(-rw-------) and I change it to 644(-rw-r--r--). Because of I must run the command before run document server, so I just change the docker's `entrypoint`, and run some command like: ```shell /bin/bash -c 'chmod 644 /etc/hosts && ls -l /etc/hosts && /app/ds/run-document-server.sh' ``` @ShockwaveNN Thanks again. Hope this can help. But I don't know if this image caused this permission problem.
Author
Owner

@Martsial commented on GitHub (Sep 19, 2021):

I finally solved the problem, it's because of the permission of /etc/hosts. Its permission is 600(-rw-------) and I change it to 644(-rw-r--r--).

Because of I must run the command before run document server, so I just change the docker's entrypoint, and run some command like:

/bin/bash -c 'chmod 644 /etc/hosts && ls -l /etc/hosts && /app/ds/run-document-server.sh'

@ShockwaveNN Thanks again. Hope this can help. But I don't know if this image caused this permission problem.

Thanks a lot! You saved me from another couple of months of misery!

<!-- gh-comment-id:922529401 --> @Martsial commented on GitHub (Sep 19, 2021): > I finally solved the problem, it's because of the permission of /etc/hosts. Its permission is 600(-rw-------) and I change it to 644(-rw-r--r--). > > Because of I must run the command before run document server, so I just change the docker's `entrypoint`, and run some command like: > > ```shell > /bin/bash -c 'chmod 644 /etc/hosts && ls -l /etc/hosts && /app/ds/run-document-server.sh' > ``` > > @ShockwaveNN Thanks again. Hope this can help. But I don't know if this image caused this permission problem. Thanks a lot! You saved me from another couple of months of misery!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Docker-DocumentServer-ONLYOFFICE#129
No description provided.