title: apierror-visualeditor-docserver-http-error: (curl error: 7) Couldn't connect to server
body: <p>I build container:
  <code>docker build -t mediawiki31 .</code></p>
  
  <p>Dockerfile with wikimedia (standard file plus adding VisualEditor):</p>
  
  <pre><code>FROM php:7.2-apache
  
  # System Dependencies.
  RUN apt-get update &amp;&amp; apt-get install -y \
          git \
          imagemagick \
          libicu-dev \
          # Required for SyntaxHighlighting
          python3 \
      --no-install-recommends &amp;&amp; rm -r /var/lib/apt/lists/*
  
  # Install the PHP extensions we need
  RUN docker-php-ext-install mbstring mysqli opcache intl
  
  
  # Install the default object cache.
  RUN pecl channel-update pecl.php.net \
      &amp;&amp; pecl install apcu \
      &amp;&amp; docker-php-ext-enable apcu
  
  # set recommended PHP.ini settings
  # see https://secure.php.net/manual/en/opcache.installation.php
  RUN { \
          echo 'opcache.memory_consumption=128'; \
          echo 'opcache.interned_strings_buffer=8'; \
          echo 'opcache.max_accelerated_files=4000'; \
          echo 'opcache.revalidate_freq=60'; \
          echo 'opcache.fast_shutdown=1'; \
          echo 'opcache.enable_cli=1'; \
      } &gt; /usr/local/etc/php/conf.d/opcache-recommended.ini
  
  # SQLite Directory Setup
  RUN mkdir -p /var/www/data \
      &amp;&amp; chown -R www-data:www-data /var/www/data
  
  # Version
  ENV MEDIAWIKI_MAJOR_VERSION 1.31
  ENV MEDIAWIKI_BRANCH REL1_31
  ENV MEDIAWIKI_VERSION 1.31.1
  ENV MEDIAWIKI_SHA512 ee49649cc37d0a7d45a7c6d90c822c2a595df290be2b5bf085affbec3318768700a458a6e5b5b7e437651400b9641424429d6d304f870c22ec63fae86ffc5152
  
  # MediaWiki setup
  RUN curl -fSL "https://releases.wikimedia.org/mediawiki/${MEDIAWIKI_MAJOR_VERSION}/mediawiki-${MEDIAWIKI_VERSION}.tar.gz" -o mediawiki.tar.gz \
      &amp;&amp; echo "${MEDIAWIKI_SHA512} *mediawiki.tar.gz" | sha512sum -c - \
      &amp;&amp; tar -xz --strip-components=1 -f mediawiki.tar.gz \
      &amp;&amp; rm mediawiki.tar.gz \
      &amp;&amp; chown -R www-data:www-data extensions skins cache images
  
  
  RUN cd /var/www/html/extensions &amp;&amp;\
      git clone -b REL1_30 https://gerrit.wikimedia.org/r/p/mediawiki/extensions/VisualEditor.git &amp;&amp;\
      cd VisualEditor &amp;&amp;\
      git submodule update --init
  </code></pre>
  
  <p>docker-compose file (also standard file but width parsoid):</p>
  
  <pre><code># MediaWiki with MariaDB
  #
  # Access via "http://localhost:8024"
  #   (or "http://$(docker-machine ip):8024" if using docker-machine)
  version: '3'
  services:
    mediawiki:
      image: mediawiki31
      restart: always
      ports:
        - 8024:80
      links:
        - database
        - parsoid
      volumes:
        - /var/www/html/images
        # After initial setup, download LocalSettings.php to the same directory as
        # this yaml and uncomment the following line and use compose to restart
        # the mediawiki service
        - ./LocalSettings.php:/var/www/html/LocalSettings.php
    database:
      image: mariadb
      restart: always
      environment:
        # @see https://phabricator.wikimedia.org/source/mediawiki/browse/master/includes/DefaultSettings.php
        MYSQL_DATABASE: my_wiki
        MYSQL_USER: pscn
        MYSQL_PASSWORD: example
        MYSQL_RANDOM_ROOT_PASSWORD: "yes"
    parsoid:
      image: thenets/parsoid:0.9.0
      ports:
        - 8035:8000
      restart: always
      environment:
        PARSOID_DOMAIN_localhost: http://localhost:8024/api.php
  </code></pre>
  
  <p>I ran compose ffile with:<br>
  <code>docker-compose -f stack.yml up</code><br>
  Generate LocalSettings.php.<br>
  Added to LocalSettings.php:  </p>
  
  <pre><code>wfLoadExtension( 'VisualEditor');
  
  $wgDefaultUserOptions['usebetatoolbar'] = 1;
  $wgDefaultUserOptions[`usebetatoolbar-cgd`] = 1;
  $wgDefaultUserOptions['wikieditor-preview'] = 0;
  $wgDefaultUserOptions['wikieditor-publish'] = 0;
  
  #$wgDefaultUserOptions['visualeditor-enable'] = 1;
  
    if ( $_SERVER['REMOTE_ADDR'] == '127.0.0.1' ) {
       $wgGroupPermissions['*']['read'] = true;
       $wgGroupPermissions['*']['edit'] = true;
      }
  
  $wgVirtualRestConfig['modules']['parsoid'] = array(
      // URL to the Parsoid instance
      // Use port 8142 if you use the Debian package
      'url' =&gt; 'localhost:8035',
      // Parsoid "domain", see below (optional)
      'domain' =&gt; 'localhost',
      // Parsoid "prefix", see below (optional)
      'prefix' =&gt; 'localhost'
  );
  </code></pre>
  
  <p>I turned on the wiki. Everything works.<br>
  I'm trying to turn on the VisualEditor and I get errors:  </p>
  
  <pre><code>apierror-visualeditor-docserver-http-error: (curl error: 7) Couldn't connect to server. 
  </code></pre>
  
  <p>and  </p>
  
  <pre><code>oldidnotfound: There is no revision with ID 0
  </code></pre>
  
  <p>I check, url <a href="http://localhost:8024/api.php" rel="nofollow noreferrer">http://localhost:8024/api.php</a> has content, url <a href="http://localhost:8035/" rel="nofollow noreferrer">http://localhost:8035/</a> too.</p>
  
  <p>Where is the problem?<br>
  I do not even know what and how to check what causes the problem.</p>