[Wikidata-bugs] [Maniphest] [Commented On] T224525: Error when running a clean wikibase-docker image: Config.getConfig is not a function
AbdBarho added a comment. @Jkbr In case it helps, we managed to work around the problem by cloning the `wdqs-frontend` repository and manually modifying the `Dockerfile` so that it does not override the config file. You can see our code here <https://github.com/code-openness/pik-wikibase> This however is about 2 months old, I hope it still works. You might also face another problem in the GUI, which is deprecated functions being used by JQuery, but this only happens in latest versions of FireFox, we tested it out with Chrome and it worked fine. TASK DETAIL https://phabricator.wikimedia.org/T224525 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: AbdBarho Cc: Jkbr, gabriel-wmde, Lucas_Werkmeister_WMDE, Lydia_Pintscher, Addshore, Tarrow, Realworldobject, AbdBarho, Aklapper, darthmon_wmde, Jelabra, Nandana, Lahi, Gq86, GoranSMilovanovic, QZanden, LawExplorer, _jensen, rosalieper, Wikidata-bugs, aude, Mbch331 ___ Wikidata-bugs mailing list Wikidata-bugs@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs
[Wikidata-bugs] [Maniphest] [Edited] T224525: Error when running a clean wikibase-docker image: Config.getConfig is not a function
AbdBarho updated the task description. TASK DETAIL https://phabricator.wikimedia.org/T224525 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: AbdBarho Cc: Lydia_Pintscher, Addshore, Tarrow, Realworldobject, AbdBarho, Aklapper, darthmon_wmde, Premeditated, Nandana, Lahi, Gq86, GoranSMilovanovic, QZanden, LawExplorer, _jensen, rosalieper, Wikidata-bugs, aude, Mbch331 ___ Wikidata-bugs mailing list Wikidata-bugs@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs
[Wikidata-bugs] [Maniphest] [Edited] T224525: Error when running a clean wikibase-docker image: Config.getConfig is not a function
AbdBarho updated the task description. TASK DETAIL https://phabricator.wikimedia.org/T224525 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: AbdBarho Cc: Lydia_Pintscher, Addshore, Tarrow, Realworldobject, AbdBarho, Aklapper, darthmon_wmde, Premeditated, Nandana, Lahi, Gq86, GoranSMilovanovic, QZanden, LawExplorer, _jensen, rosalieper, Wikidata-bugs, aude, Mbch331 ___ Wikidata-bugs mailing list Wikidata-bugs@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs
[Wikidata-bugs] [Maniphest] [Created] T224525: Error when running a clean wikibase-docker image: Config.getConfig is not a function
AbdBarho created this task. AbdBarho added a project: Wikibase-Containers. Restricted Application added a subscriber: Aklapper. Restricted Application added a project: Wikidata. TASK DESCRIPTION What is the problem === I have tried setting up an instance of the wikibase-docker image but I encountered a problem with the Wikidata Query Service GUI. In `http://localhost:8282/` I get the following error message in my browser's console: `CONFIG.getConfig is not a function`. --- Steps to reproduce it = I am trying to run the image on an Ubuntu virtual machine in VM VirtualBox inside a Windows 10 Host. Windows version: 1809 (Build: 17763.503) VM VirtualBox version: 6.0.8 r130520 (Qt5.6.2)y Ubuntu version: Linux VirtualBox 4.15.0-45-generic #48-Ubuntu x86_64 x86_64 x86_64 GNU/Linux what I have done: git clone https://github.com/wmde/wikibase-docker.git # commit ID when cloned 57f4d1509375ace2cef6e2c73210f3934895fb75 # repository state when cloned https://github.com/wmde/wikibase-docker/tree/57f4d1509375ace2cef6e2c73210f3934895fb75 cd wikibase-docker/ docker-compose pull docker-compose up I wait until I see the messages: Got no real changes Sleeping for 10 secs so I assume every thing is ready. However, when I go to `http://localhost:8282/`, The icon in top left is not loaded and the items on the left side bar do not exist, and in the console I found the following error: `CONFIG.getConfig is not a function`. F29268584: console.png <https://phabricator.wikimedia.org/F29268584> --- Expected behaviour == A normal functioning page should appear just like the official Query Service Page <https://query.wikidata.org/> --- What is (possibly) causing the problem. === Note: Since this docker image is a composition of a lot of repos and other images, all of the links in the coming sections are permalinks to Github at the specific state when I encountered the problem. I will also state the commit ID when possible. All of this happened on the 28/05/2019. Please excuse some of the naivety in my approach, I am a beginner when it comes to docker. Checking the file `config.js` reveals that the function itself does not exist. F29268590: tree.png <https://phabricator.wikimedia.org/F29268590> After some digging, I found out the the docker image for this is `wikibase/wdqs-frontend`. Checking the Dockerfile in wdqs-frontend <https://github.com/wmde/wikibase-docker/blob/57f4d1509375ace2cef6e2c73210f3934895fb75/wdqs-frontend/latest/Dockerfile> reveals the following: # ... ADD https://github.com/wikimedia/wikidata-query-gui/archive/master.zip ./master.zip # Creates /wikidata-query-gui-master RUN unzip master.zip && rm master.zip # ... COPY --from=fetcher /wikidata-query-gui-master /tmp/wikidata-query-gui-master WORKDIR /tmp/wikidata-query-gui-master # ... COPY --from=builder /tmp/wikidata-query-gui-master /usr/share/nginx/html RUN echo "" > style.css COPY entrypoint.sh /entrypoint.sh COPY config.js /templates/config.js COPY default.conf /templates/default.conf So the code for the actual GUI is in the repo `https://github.com/wikimedia/wikidata-query-gui` and it always downloads the most updated version of that repo. However, the config file in the wikidata-query-gui repo <https://github.com/wikimedia/wikidata-query-gui/blob/70ed8ec97f3aeb892dd99f5d9320232c41af95af/wikibase/config.js> does have the `getConfig()` method that is missing. (commit for the link is `70ed8ec97f3aeb892dd99f5d9320232c41af95af`) So going back to the Dockerfile in wdqs-frontend <https://github.com/wmde/wikibase-docker/blob/57f4d1509375ace2cef6e2c73210f3934895fb75/wdqs-frontend/latest/Dockerfile>, the last couple of lines do the following: COPY entrypoint.sh /entrypoint.sh COPY config.js /templates/config.js # ... ENTRYPOINT ["/entrypoint.sh"] The script actually copies another config.js file <https://github.com/wmde/wikibase-docker/blob/57f4d1509375ace2cef6e2c73210f3934895fb75/wdqs-frontend/latest/config.js> from `wdqs-frontend/latest`. This file does not have the `getConfig()` function and looks like an older version of the other (valid) config.js file in wikidata-query-gui. The copying is done to `/templates/config.js`. However, in the entypoint.sh file <https://github.com/wmde/wikibase-docker/blob/57f4d1509375ace2cef6e2c73210f3934895fb75/wdqs-frontend/latest/entrypoint.sh> that is also copied, I found the following: envsubst < /templates/config.js > /usr/share/nginx/html/wikibase/config.js And when this script runs,