Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When using localhost in .env with example settings, Special:Search shows an error #384

Open
rodrigomorales1 opened this issue Nov 22, 2022 · 5 comments

Comments

@rodrigomorales1
Copy link

rodrigomorales1 commented Nov 22, 2022

Table of Contents

  1. The context
  2. The problem
  3. Additional information

The context

I decided to troubleshoot an issue that I had previously posted: #383. For this reason, I removed all the files that I had created in my previous attempts of installing Wikibase. These are the commands I executed.

Stop all the containers.

$ docker container ls -a -q | xargs -r docker container stop

Remove all the containers.

$ docker container ls -a -q | xargs -r docker container rm

Stop and remove containers, networks.

$ docker-compose down

Remove all volumes.

$ docker volume ls -q | xargs -r docker volume rm

I downloaded the files in the example directory from the main branch as of the time of this writing (permalink to commit).

and changed the following lines (see output of the diff command below). After running diff, I deleted the file .env-example and renamed .env-my-modifications to .env.

$ diff -u .env-example .env-my-modifications
--- .env-example        2022-11-22 15:28:41.040206855 -0500
+++ .env-my-modifications       2022-11-22 15:14:20.646879170 -0500
@@ -34,22 +34,22 @@
 ## Wikibase Configuration
 WIKIBASE_PINGBACK=false
 # wikibase.svc is the internal docker hostname, change this value to the public hostname
-WIKIBASE_HOST=wikibase.svc
+WIKIBASE_HOST=localhost
 WIKIBASE_PORT=80
 
 ## WDQS-frontend Configuration
 # wdqs-frontend.svc is the internal docker hostname, change this value to the public hostname
-WDQS_FRONTEND_HOST=wdqs-frontend.svc
+WDQS_FRONTEND_HOST=localhost
 WDQS_FRONTEND_PORT=8834
 
 ## Quickstatements Configuration
 # quickstatements.svc is the internal docker hostname, change this value to the public or local hostname
 QS_PUBLIC_SCHEME_HOST_AND_PORT=http://localhost:8840
-QUICKSTATEMENTS_HOST=quickstatements.svc
+QUICKSTATEMENTS_HOST=localhost
 QUICKSTATEMENTS_PORT=8840
 
 ## ElasticSearch
 ## Comment out MW_ELASTIC_HOST to disable ElasticsSearch
 ## See https://github.com/wmde/wikibase-release-pipeline/blob/wmde.9/Docker/build/WikibaseBundle/LocalSettings.d.template/WikibaseCirrusSearch.php#L6
-MW_ELASTIC_HOST=elasticsearch.svc
+MW_ELASTIC_HOST=localhost
 MW_ELASTIC_PORT=9200

I then ran the docker-compose command as shown below.

$ docker-compose -f docker-compose.yml -f docker-compose.extra.yml up -d
WARN[0000] The "OAUTH_CONSUMER_KEY" variable is not set. Defaulting to a blank string. 
WARN[0000] The "OAUTH_CONSUMER_SECRET" variable is not set. Defaulting to a blank string. 
[+] Running 15/15
 ⠿ Network wikibase-docker_default                 Created  0.0s
 ⠿ Volume "wikibase-docker_query-service-data"     Created  0.0s
 ⠿ Volume "wikibase-docker_shared"                 Created  0.0s
 ⠿ Volume "wikibase-docker_elasticsearch-data"     Created  0.0s
 ⠿ Volume "wikibase-docker_mediawiki-mysql-data"   Created  0.0s
 ⠿ Volume "wikibase-docker_quickstatements-data"   Created  0.0s
 ⠿ Container wikibase-docker-elasticsearch-1       Started  4.3s
 ⠿ Container wikibase-docker-mysql-1               Started  4.5s
 ⠿ Container wikibase-docker-wdqs-1                Started  4.6s
 ⠿ Container wikibase-docker-wikibase_jobrunner-1  Started  5.2s
 ⠿ Container wikibase-docker-wikibase-1            Started  5.1s
 ⠿ Container wikibase-docker-wdqs-proxy-1          Started  5.2s
 ⠿ Container wikibase-docker-wdqs-frontend-1       Started  5.8s
 ⠿ Container wikibase-docker-wdqs-updater-1        Started  2.2s
 ⠿ Container wikibase-docker-quickstatements-1     Started  2.1s

For the record, this was the status of the containers.

$ docker container ls
CONTAINER ID   IMAGE                                    COMMAND                   CREATED         STATUS         PORTS                                   NAMES
c96e9b405aa0   wikibase/quickstatements:wmde.9          "/bin/bash /entrypoi…"    3 minutes ago   Up 3 minutes   0.0.0.0:8840->80/tcp, :::8840->80/tcp   wikibase-docker-quickstatements-1
3a8d2565fd82   wikibase/wdqs:0.3.115-wmde.9             "/entrypoint.sh /run…"    3 minutes ago   Up 3 minutes                                           wikibase-docker-wdqs-updater-1
66f4c115b338   wikibase/wdqs-frontend:wmde.9            "/entrypoint.sh ngin…"    3 minutes ago   Up 3 minutes   0.0.0.0:8834->80/tcp, :::8834->80/tcp   wikibase-docker-wdqs-frontend-1
a26dec7d23a2   wikibase/wdqs-proxy:wmde.9               "/bin/sh -c \"/entryp…"   3 minutes ago   Up 3 minutes   80/tcp                                  wikibase-docker-wdqs-proxy-1
a8488fb11d53   wikibase/wikibase-bundle:1.37.6-wmde.9   "/bin/bash /entrypoi…"    3 minutes ago   Up 3 minutes   0.0.0.0:80->80/tcp, :::80->80/tcp       wikibase-docker-wikibase-1
eece2d5f8a92   wikibase/wikibase-bundle:1.37.6-wmde.9   "/bin/bash /jobrunne…"    3 minutes ago   Up 3 minutes   80/tcp                                  wikibase-docker-wikibase_jobrunner-1
12a915d4c668   wikibase/elasticsearch:6.8.23-wmde.9     "/usr/local/bin/dock…"    3 minutes ago   Up 3 minutes   9200/tcp, 9300/tcp                      wikibase-docker-elasticsearch-1
91ff3731bdff   mariadb:10.9                             "docker-entrypoint.s…"    3 minutes ago   Up 3 minutes   3306/tcp                                wikibase-docker-mysql-1
b7fd50ed590d   wikibase/wdqs:0.3.115-wmde.9             "/entrypoint.sh /run…"    3 minutes ago   Up 3 minutes   9999/tcp                                wikibase-docker-wdqs-1

At this point, I could

$ curl \
  -G 'http://localhost:8834/proxy/wdqs/bigdata/namespace/wdq/sparql' \
  -H 'Accept: text/csv' \
  --data-urlencode query='
SELECT ?a ?b ?c {
  ?a ?b ?c.
}'
a,b,c
  • Send requests through api.php (see below)
curl \
  --get \
  --data-urlencode 'format=json' \
  --data-urlencode 'action=wbsearchentities' \
  --data-urlencode 'type=item' \
  --data-urlencode 'language=en' \
  --data-urlencode 'search=foo' \
  'http://localhost/w/api.php' | jq -r ''
{
  "searchinfo": {
    "search": "foo"
  },
  "search": [],
  "success": 1
}

The problem

When I searched for anything in http://localhost/wiki/Special:Search, the following error was shown.

An error has occurred while searching: We could not complete your search due to a temporary problem. Please try again later. 

image

Additional information

Note 1

In #381, I had reported the same error. However, the error was caused because I hadn't downloaded the files extra-install.sh and jobrunner-entrypoint.sh. This time, I downloaded them, but still I couldn't perform searches.

Note 2

When I use the default settings in example, this error doesn't happen (see image below). Recall that in .env I had changed the value for *_HOST variables to localhost (see output of diff command above).

image

@addshore
Copy link
Contributor

Could you post the logs for the wikibase container during the initial setup?
Possibly also logs of the elasticsearch container while you are searching, and also look in the /var/logs/mediawiki directory of the wikibase container while you are searching?

@tarrow
Copy link
Contributor

tarrow commented Nov 29, 2022 via email

@tarrow
Copy link
Contributor

tarrow commented Dec 1, 2022 via email

@schelv
Copy link
Contributor

schelv commented Jan 2, 2023

Currently the comments next to the variables seem to suggest that the value should be changed.
The comments would be more clear if they explain when and why the values should be changed.

@JeongYunLee
Copy link

JeongYunLee commented Aug 8, 2023

hi, I have the same problem with you now. Did you solve this problem?
Also, I'm meeting same errors when I used default .env file in the example folder... (I mean I don't change host name into localhost)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants