Wordpress: problem accessing wordpress api from this image

Created on 1 Feb 2015  路  5Comments  路  Source: docker-library/wordpress

Hi,
I've run this image on two different machines, but encountered the same issue on both. Everything appears to work fine, but the wordpress admin pages respond very slowly and display this error at the top:
"Warning: An unexpected error occurred. Something may be wrong with WordPress.org or this server鈥檚 configuration. If you continue to have problems, please try the support forums. (WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.) in /var/www/html/wp-includes/update.php on line 295"
It appears to be struggling to contact api.wordpress.org. I've checked from the container that I can curl the API, and the install seems to work - I installed a couple of plugins, for instance. I've tried turning on PHP logging and tracing through the update code, but I can't see anything out of the ordinary.
I'm running docker v1.4 in an ubuntu VM via vagrant, on a linux mint host. Wordpress is accessed via an nginx reverse proxy, but in the other instance I set up I accessed wordpress direct (not via nginx proxy).
It looks like a DNS or proxy issue, or that something is timing out, but as I say other connectivity on the instance appears fine. Any ideas?

Most helpful comment

Likewise, I seem to be hitting the same issue. I have 1.4G free (out of 2G) memory. Any other ideas?

All 5 comments

It could be that your wordpress container is struggling for memory since it is inside a vm. Why not just run docker on the host since you have linux?

Closing old issue, if you feel this was closed in error please let us know.

@charltones how did you fix this plz ?

Likewise, I seem to be hitting the same issue. I have 1.4G free (out of 2G) memory. Any other ideas?

Same here,

I'm using this docker-compose.yml description to launch my WP:

version: '3.1'

services:
  db:
    image: mysql:5.7
    restart: always
    environment:
      MYSQL_DATABASE: wordpress
      MYSQL_USER: bn_wordpress
      MYSQL_PASSWORD: wordpress_password
      MYSQL_RANDOM_ROOT_PASSWORD: 1

  wordpress:
    image: 'wordpress:5.2.2-php7.1-apache'
    ports:
      - '80:80'
      - '443:443'
    volumes:
      - 'wordpress_data:/var/www/html'
    depends_on:
      - db
    environment:
      WORDPRESS_DB_HOST: db
      WORDPRESS_DB_USER: bn_wordpress
      WORDPRESS_DB_PASSWORD: wordpress_password
      WORDPRESS_DB_NAME: wordpress

volumes:
  wordpress_data:
    driver: local

Using the tip from the image documentation about how to use the WP-CLI, I tried to install the pl_PL core language with:

docker run -it --rm --volumes-from public-website_wordpress_1 --network container:public-website_wordpress_1 wordpress:cli language core install pl_PL

What I get instead of desired output:

Error: An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>. "cURL error 28: Resolving timed out after 3000 milliseconds"

I looked it up here and indeed both of those PHP vars:

  • CURLOPT_TIMEOUT
  • CURLOPT_CONNECTTIMEOUT

    are both set to 5 (seconds). I thought adjusting my docker-compose.ymlaccordingly with env var:

WORDPRESS_CONFIG_EXTRA: |
        define('CURLOPT_TIMEOUT', 60 );
        define('CURLOPT_CONNECTTIMEOUT', 30 );

But this does not seem to have any effect at all, still getting the "cURL error 28: Resolving timed out after 3000 milliseconds" message.

Has any of you any idea why the timeout drops out after those 3000 miliseconds, and not after 5 seconds set in the CURLOPT_TIMEOUT and CURLOPT_CONNECTTIMEOUT in the config files coming from wp-includes?

The host definitely has the firewall set to allow the outgoing connections. Out of the box the wordpress image should not have any problems with DNS resolving, am I right (throwing the ideas here only)?

I'm clueless here -.-

Could we please reopen this issue @yosifkit?

Was this page helpful?
0 / 5 - 0 ratings