How to fix cURL error 6: getaddrinfo()

Keywords: WordPress - AWS - Technical issue - Other
bnsupport ID: 3552a1c3-14a6-f491-8523-95a5156a2e2c
Description:
Hi

I’m getting the following error: cURL error 6: getaddrinfo() thread failed to start

This happens at random times which make it not possible to update any plugins/themes etc.

I’ve never experienced this on any other server set up that I’ve done over the years. It’s my first time doing a set up with bitnami and first time experiencing this error.

How can this be fixed?

Hi @essoversion,

this seems to be a connection problem between your WordPress application and the WordPress’ servers with the plugins’ information. Do you continue experiencing this problem? If so, let’s try to resolve the domain name of WordPress from the command line

sudo apt update
sudo apt install dnsutils
dig wordpress.org

Do you get any error? What’s the content of the /etc/resolv.conf file?

If everything goes fine and unless you have a rule in the Security Group of your instance that blocks any of the inbound/outbound connections, I think this is an app’s issue and the WordPress’ developers should give you more information.

I don’t get how this is a WordPress app issue.

To get the issue to somewhat resolve I have to restart the Lightsail instance. It will then work fine for a few hours then the issue will occur again. So I’m in a constant state of restarting everyday.

Did not get an error for “dig wordpress.org” however note this was done directly after a restart.

/etc/resolv.conf

Contents

domain ec2.internal
search ec2.internal
nameserver 172.26.0.2

Hi @essoversion,

I mentioned that if there is not any problem with the connectivity in the instance, then it should be an app’s problem. However, it’s clear that there is a connectivity problem in the instance and that’s why everything works fine after restarting. I believe this is a domain resolution problem, can you run this command to modify the content of the /etc/resolv.conf file?

sudo sh -c "echo nameserver 8.8.8.8 > /etc/resolv.conf"

You can learn more about this command here

Do you still get the error after running it?

If you get the error in the application again, please run these commands before restarting the instance.

dig wordpress.org
ping wordpress.org

Thanks

I woke up this morning and the site would not load, not even PHPMyadmin would load.

I ran

“dig wordpress.org” output as follows:

; <<>> DiG 9.11.5-P4-5.1+deb10u2-Debian <<>> wordpress.org
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 38895
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;wordpress.org. IN A

;; ANSWER SECTION:
wordpress.org. 146 IN A 198.143.164.252

;; Query time: 0 msec
;; SERVER: 172.26.0.2#53(172.26.0.2)
;; WHEN: Wed Sep 02 11:15:39 UTC 2020
;; MSG SIZE rcvd: 58

bitnami@ip-172-26-48-90:~$ dig wordpress.org

; <<>> DiG 9.11.5-P4-5.1+deb10u2-Debian <<>> wordpress.org
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 15605
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;wordpress.org. IN A

;; ANSWER SECTION:
wordpress.org. 0 IN A 198.143.164.252

;; Query time: 1 msec
;; SERVER: 172.26.0.2#53(172.26.0.2)
;; WHEN: Wed Sep 02 11:33:27 UTC 2020
;; MSG SIZE rcvd: 58

“ping wordpress.org” output as follows:

PING wordpress.org (198.143.164.252) 56(84) bytes of data.
64 bytes from wordpress.org (198.143.164.252): icmp_seq=1 ttl=33 time=23.5 ms
64 bytes from wordpress.org (198.143.164.252): icmp_seq=2 ttl=33 time=23.5 ms
64 bytes from wordpress.org (198.143.164.252): icmp_seq=3 ttl=33 time=23.6 ms
64 bytes from wordpress.org (198.143.164.252): icmp_seq=4 ttl=33 time=23.6 ms

Ran the following:

sudo sh -c “echo nameserver 8.8.8.8 > /etc/resolv.conf”

However once I restart this file is overwritten back to the default. Also the above only changes to Google public DNS and does not fix the root problem.

Hi @essoversion,

From the information you provided at the beginning of the thread

I thought you only had problems when installing plugins/themes, but it seems there is a bigger problem here. Checking the logs of the Bitnami support tool information you shared, it seems the server is reaching the limits

[28-Aug-2020 01:15:16] WARNING: [pool www] server reached max_children setting (5), consider raising it
[28-Aug-2020 06:18:45] ERROR: fork() failed: Resource temporarily unavailable (11)

You are using a low-performance instance (512MB of RAM) and it only had 62MB available when running the support tool

-----------------------------------
Display amount of free and used memory in the system
-----------------------------------
Running: free -m
In: /opt/bitnami

Output:

              total        used        free      shared  buff/cache   available
Mem:            482         346           7          61         129          62
Swap:           634         345         289

Can you update the instance type to have more RAM memory and confirm that the max_children value is increased properly?

cat /opt/bitnami/php/etc/bitnami/common.conf

Thanks

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.