Logspam on Windows ("The MW_DOCKER_UID variable is not set. Defaulting to a blank string.")
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:

time="2023-07-06T17:57:19-07:00" level=warning msg="The \"MW_DOCKER_UID\" variable is not set. Defaulting to a blank string."
time="2023-07-06T17:57:19-07:00" level=warning msg="The \"MW_DOCKER_GID\" variable is not set. Defaulting to a blank string."
time="2023-07-06T17:57:19-07:00" level=warning msg="The \"MW_DOCKER_UID\" variable is not set. Defaulting to a blank string."
time="2023-07-06T17:57:19-07:00" level=warning msg="The \"MW_DOCKER_GID\" variable is not set. Defaulting to a blank string."
time="2023-07-06T17:57:19-07:00" level=warning msg="The \"MW_DOCKER_UID\" variable is not set. Defaulting to a blank string."
time="2023-07-06T17:57:19-07:00" level=warning msg="The \"MW_DOCKER_GID\" variable is not set. Defaulting to a blank string."

image.png (307×1 px, 54 KB)

image.png (905×1 px, 171 KB)

What should have happened instead?:

  • no warning messages about MW_DOCKER_UID and MW_DOCKER_GID

Software version (skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

  • May be intentional. Is generating noise/logspam on every docker compose exec mediawiki though.
  • Possible fixes
    • Reduce to 2 warnings instead of 6?
    • Suppress this warning for non-Linux?
    • Suppress this warning for everyone by default, and use a debug var to turn it back on?
    • Get rid of this warning completely?
    • Add to DEVELOPING.md that Windows/Mac users should set these variables to blank in their .env file <--- I think I prefer this approach.

Event Timeline

Novem_Linguae renamed this task from Logspam on Windows ("The MW_DOCKER"UID variable is not set. Defaulting to a blank string.") to Logspam on Windows ("The MW_DOCKER_UID" variable is not set. Defaulting to a blank string.").Jul 7 2023, 1:10 AM
Novem_Linguae renamed this task from Logspam on Windows ("The MW_DOCKER_UID" variable is not set. Defaulting to a blank string.") to Logspam on Windows ("The MW_DOCKER_UID variable is not set. Defaulting to a blank string.").

I don't see that error string "variable is not set. Defaulting to a blank string." in the code for the repo. That warning for using an undeclared variable might be baked into Docker.

Maybe something like this somewhere would fix it:

if ( notLinux ) {
    MW_DOCKER_UID = '';
    MW_DOCKER_GID = '';
}

Hacky workaround: We could edit this page to tell Windows/Mac users to add this to their .env files. Tested, works.

MW_DOCKER_UID=
MW_DOCKER_GID=

Change 936804 had a related patch set uploaded (by Novem Linguae; author: Novem Linguae):

[mediawiki/core@master] DEVELOPERS.md: fix Docker logspam in Windows

https://gerrit.wikimedia.org/r/936804

Change 936804 merged by jenkins-bot:

[mediawiki/core@master] DEVELOPERS.md: fix Docker logspam in Windows

https://gerrit.wikimedia.org/r/936804

Novem_Linguae claimed this task.