Theia-python-docker build failing

I am trying to build this docker file and it is failing with error Failed to resolve module: filenamify

Dockerfile

Build logs

     => ERROR [6/6] RUN yarn --pure-lockfile &&     NODE_OPTIONS="--max_old_space_size=4096" yarn theia build &&     yarn theia download:plugins &&     yarn --production &&     yarn auto  241.9s
------                                                                                                                                                                                         
 > [6/6] RUN yarn --pure-lockfile &&     NODE_OPTIONS="--max_old_space_size=4096" yarn theia build &&     yarn theia download:plugins &&     yarn --production &&     yarn autoclean --init &&     echo *.ts >> .yarnclean &&     echo *.ts.map >> .yarnclean &&     echo *.spec.* >> .yarnclean &&     yarn autoclean --force &&     yarn cache clean:                                       
#10 0.473 yarn install v1.22.4                                                                                                                                                                 
#10 0.498 info No lockfile found.                                                                                                                                                              
#10 0.500 $ node-gyp install                                                                                                                                                                   
#10 0.637 gyp info it worked if it ends with ok
#10 0.639 gyp info using node-gyp@5.1.0
#10 0.639 gyp info using node@12.18.3 | linux | x64
#10 0.853 gyp http GET https://nodejs.org/download/release/v12.18.3/node-v12.18.3-headers.tar.gz
#10 1.077 gyp http 200 https://nodejs.org/download/release/v12.18.3/node-v12.18.3-headers.tar.gz
#10 1.596 gyp http GET https://nodejs.org/download/release/v12.18.3/SHASUMS256.txt
#10 1.722 gyp http 200 https://nodejs.org/download/release/v12.18.3/SHASUMS256.txt
#10 1.724 12.18.3
#10 1.724 gyp info ok 
#10 1.741 [1/4] Resolving packages...
#10 19.68 warning @theia/callhierarchy > @theia/core > @theia/application-package > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
#10 19.69 warning @theia/callhierarchy > @theia/core > @theia/application-package > request > uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
#10 22.44 warning @theia/callhierarchy > @theia/monaco > @theia/filesystem > trash > uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
#10 22.84 warning @theia/callhierarchy > @theia/core > @theia/application-package > request > har-validator@5.1.5: this library is no longer supported
#10 28.18 warning @theia/callhierarchy > @theia/monaco > @theia/filesystem > trash > xdg-trashdir > @sindresorhus/df > execa > cross-spawn-async@2.2.5: cross-spawn no longer requires a build toolchain, use it instead
#10 59.39 warning @theia/git > dugite-extra > dugite-no-gpl > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
#10 82.67 warning @theia/plugin-ext > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
#10 88.99 warning @theia/plugin-ext-vscode > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
#10 93.65 warning @theia/preview > @types/highlight.js@10.1.0: This is a stub types definition. highlight.js provides its own type definitions, so you do not need this installed.
#10 107.2 warning @theia/cli > mocha > debug@3.2.6: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
#10 108.3 warning @theia/cli > mocha > chokidar > fsevents@2.1.3: "Please update to latest v2.3 or v2.2"
#10 111.1 warning @theia/cli > @theia/application-manager > electron-rebuild > node-gyp > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
#10 116.0 warning @theia/cli > @theia/application-manager > font-awesome-webpack > css-loader > cssnano > autoprefixer > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
#10 116.2 warning @theia/cli > @theia/application-manager > font-awesome-webpack > css-loader > cssnano > postcss-merge-rules > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
#10 118.5 warning @theia/cli > @theia/application-manager > font-awesome-webpack > css-loader > cssnano > postcss-merge-rules > caniuse-api > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
#10 118.6 warning @theia/cli > @theia/application-manager > font-awesome-webpack > css-loader > cssnano > postcss-merge-rules > postcss-selector-parser > flatten@1.0.3: flatten is deprecated in favor of utility frameworks such as lodash.
#10 121.5 [2/4] Fetching packages...
#10 157.8 info fsevents@2.1.3: The platform "linux" is incompatible with this module.
#10 157.8 info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
#10 157.9 [3/4] Linking dependencies...
#10 157.9 warning "@theia/debug > requestretry@3.1.0" has unmet peer dependency "request@2.*.*".
#10 157.9 warning "@theia/scm > react-autosize-textarea@7.1.0" has unmet peer dependency "react@^0.14.0 || ^15.0.0 || ^16.0.0".
#10 157.9 warning "@theia/scm > react-autosize-textarea@7.1.0" has unmet peer dependency "react-dom@^0.14.0 || ^15.0.0 || ^16.0.0".
#10 157.9 warning "@theia/messages > react-perfect-scrollbar@1.5.8" has unmet peer dependency "react@>=16.3.3".
#10 157.9 warning "@theia/messages > react-perfect-scrollbar@1.5.8" has unmet peer dependency "react-dom@>=16.3.3".
#10 157.9 warning "@theia/cli > @theia/application-manager > font-awesome-webpack@0.0.5-beta.2" has unmet peer dependency "font-awesome@>=4.3.0".
#10 157.9 warning "@theia/cli > @theia/application-manager > @theia/compression-webpack-plugin@3.0.0" has incorrect peer dependency "webpack@^4.3.0".
#10 157.9 warning "@theia/cli > @theia/application-manager > font-awesome-webpack > less-loader@2.2.3" has incorrect peer dependency "less@^2.3.1".
#10 171.6 [4/4] Building fresh packages...
#10 211.2 Done in 210.69s.
#10 211.8 yarn run v1.22.4
#10 211.8 $ /home/theia/node_modules/.bin/theia build
#10 212.7 Failed to resolve module: filenamify
#10 240.5 Error: webpack exited with an unexpected signal: SIGKILL.
#10 240.5     at ChildProcess.<anonymous> (/home/theia/node_modules/@theia/application-manager/lib/application-process.js:59:28)
#10 240.5     at ChildProcess.emit (events.js:315:20)
#10 240.5     at maybeClose (internal/child_process.js:1021:16)
#10 240.5     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
#10 240.7 error Command failed with exit code 1.
#10 240.7 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@akhilputhiry thank you for the discussion :+1:
The build of latest and next of theia-python-docker is successfully passing on CI:

Are you doing anything differently? For example what version of @theia dependencies are you using? Are you attempting to build with an old lockfile (yarn.lock)?

Hi @vince-fugnitto

I played around it for some time.

The build fails in Mac
The build fails inn RHEL based images.
Its working only in Ubuntu (docker in docker using ubuntu as machine image)

Any thoughts around it

@akhilputhiry The filenamify issue seems appear on a lot of builds but has no actual effect on the build output and is just a warning.

Your main issue seems to be that webpack is getting killed by your OS during bundling. Usually I would assume that this is a memory related issue (webpack is quite memory hungry and the bundling step can easily use 3+ GB of memory). However, it’s weird that it works for Ubuntu based images but fails for RHEL. Is this the same machine? I would still recommend that you look into memory limitations. See this other issue I found on the same error for jupyterlab.

1 Like

@akhilputhiry to add to what Mark said, I confirmed that the build is successful on Ubuntu, macOS, and on CI.

docker build --no-cache . -t theiaide/theia-python:latest