Docker Desktop 4.2.0 fails to run when %USERPROFILE% path is invalid regex · Issue #12374 · docker/for-win (original) (raw)

Actual behavior

Docker Desktop fails to open and displays an error instead:
MicrosoftTeams-image

Expected behavior

Docker Desktop opens correctly and runs

Information

Steps to reproduce the behavior

For me, this breaks every time:

  1. Have a UserProfile path with an open parentheses but not a closing one. Mine is C:\Users\KashCummings(Credera. These are AD bound names, so cannot change
  2. Install Docker Desktop v4.2.0
  3. Run docker desktop
  4. The above error pops up

Based on a limited debug, it appears something about the log file rotation has broken between 4.1.1 and 4.2.0. The error message above the dialog box looks similar to the message provided by docker, which makes me think it's trying to do a regex match on a string that's an invalid regex string.

Error:

A JavaScript error occurred in the main process
Uncaught Exception:
SyntaxError: Invalid regular expression:
C:\Users\KashCummings(Credera\AppData\Roaming\Docker... electron-2021-11-15-15.log/:
Unterminated group
at String.match(<anonymous»)
at Object. FileStreamRotator.getStream (C:\Program
Files\Docker\Docker\frontend resources app.asar\node_modules\file-stream-rotator Fil.:26)
at new DailyRotateFile (C:\Program
Files\Docker\Docker\frontend\resources app.asar\node_modules winston-daily-rotate-..:57)
at Object.<anonymous (C:\Program
Files\Docker\Docker\frontend\resources app.asar\src_transpiled logger.js:36:20)
at Module._compile (node internal/modules/cjs/loader:1110:14)
at Object.Module._extensions..js (node.internal/modules/cjs/loader:1140:10)
at Module.load (node:internal/modules/cs/loader:982:32)
at Module._load (node:internal/modules/cs/loader:823:12)
at Function.c._load (node:electron/js2c/asar_bundle:5:13331)
at Module.require (node:internal/modules/cjs/loader:1006:19)