Open rizkyekoputra opened 5 years ago
This is Dockerfile that I use
# GENERATED FILE, DO NOT MODIFY!
# To update this file please edit the relevant template and run the generation
# task `build/dockerfile_writer.rb`
# See doc/docker/README.md or https://github.com/instructure/canvas-lms/tree/master/doc/docker
FROM instructure/ruby-passenger:2.4-xenial
ENV APP_HOME /usr/src/app/
ENV RAILS_ENV "production"
ENV NGINX_MAX_UPLOAD_SIZE 10g
ENV YARN_VERSION 1.16.0-1
# Work around github.com/zertosh/v8-compile-cache/issues/2
# This can be removed once yarn pushes a release including the fixed version
# of v8-compile-cache.
ENV DISABLE_V8_COMPILE_CACHE 1
USER root
WORKDIR /root
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \
&& printf 'path-exclude /usr/share/doc/*\npath-exclude /usr/share/man/*' > /etc/dpkg/dpkg.cfg.d/01_nodoc \
&& apt-get update -qq \
&& apt-get install -qqy --no-install-recommends \
nodejs \
yarn="$YARN_VERSION" \
libxmlsec1-dev \
python-lxml \
libicu-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /home/docker/.gem/ruby/$RUBY_MAJOR.0
RUN if [ -e /var/lib/gems/$RUBY_MAJOR.0/gems/bundler-* ]; then BUNDLER_INSTALL="-i /var/lib/gems/$RUBY_MAJOR.0"; fi \
&& gem uninstall --all --ignore-dependencies --force $BUNDLER_INSTALL bundler \
&& gem install bundler --no-document -v 1.17.3 \
&& find $GEM_HOME ! -user docker | xargs chown docker:docker
WORKDIR $APP_HOME
COPY . $APP_HOME
# optimizing for size here ... get all the dev dependencies so we can
# compile assets, then throw away everything we don't need
#
# the privilege dropping could be slightly less verbose if we ever add
# gosu (here or upstream)
#
# TODO: once we have docker 17.05+ everywhere, do this via multi-stage
# build
RUN bash -c ' \
# bash cuz better globbing and comments \
set -e; \
\
sudo -u docker -E env HOME=/home/docker PATH=$PATH bundle install --jobs 8; \
yarn install --pure-lockfile; \
COMPILE_ASSETS_NPM_INSTALL=0 bundle exec rake canvas:compile_assets; \
\
# downgrade to prod dependencies \
sudo -u docker -E env HOME=/home/docker PATH=$PATH bundle install --without test development; \
sudo -u docker -E env HOME=/home/docker PATH=$PATH bundle clean --force; \
yarn install --prod; \
\
# now some cleanup... \
rm -rf \
/home/docker/.bundle/cache \
$GEM_HOME/cache \
$GEM_HOME/bundler/gems/*/{.git,spec,test,features} \
$GEM_HOME/gems/*/{spec,test,features} \
`yarn cache dir` \
/root/.node-gyp \
/tmp/phantomjs \
.yardoc \
client_apps/canvas_quizzes/{tmp,node_modules} \
config/locales/generated \
gems/*/node_modules \
gems/plugins/*/node_modules \
log \
public/dist/maps \
public/doc/api/*.json \
public/javascripts/translations \
tmp-*.tmp'
USER docker
Do you have at least 8GB of RAM dedicated to this process?
not dedicated, I use mac book pro that just has 8GB RAM
unfortunately the production image requires upwards of 8GB of ram so it’s likely the process is running out of memory.
is there any production image that we can just directly use? maybe in docker hub?
There is https://hub.docker.com/r/instructure/canvas-lms, but it looks like it's a few months behind. I'm trying to figure out why that is.
In general though, we only use docker for development, we don't support it for a production build currently.
unfortunately the production image requires upwards of 8GB of ram so it’s likely the process is running out of memory.
Can confirm that increasing Docker's resource limit to 5GB and swap size to 4GB fixed this error for me.
I'm having this same issue on fresh Centos 7.6 VPS with 8GB ram and 8GB of swap space.
Node version: v10.22.0 Ruby Version: 2.6
Any help is greatly appreciated~
@rippledj try lowering the --max-old-space-size on each of the nodejs scripts inside the package.json.
I made all those values 4192 on VPS with 8GB of RAM and 8GB of swap, but still failed. the tail of the output is below. Do you have another suggestion? :). Is this for sure for sure a RAM problem? I'm not very familiar with Yarn. I tried it with the --trace option but didn't seen any more useful information.
/usr/local/rvm/gems/ruby-2.6.5/gems/soap4r-ruby1.9-2.0.5/lib/soap/mapping/encodedregistry.rb:150: warning: constant ::Fixnum is deprecated
/usr/local/rvm/gems/ruby-2.6.5/gems/soap4r-ruby1.9-2.0.5/lib/soap/mapping/encodedregistry.rb:216: warning: constant ::Fixnum is deprecated
** Invoke canvas:compile_assets (first_time)
** Execute canvas:compile_assets
--> Starting: 'Making sure node_modules are up to date'
** Invoke js:yarn_install (first_time)
** Execute js:yarn_install
node is: v10.22.0 (/usr/bin/node)
yarn install v1.22.4
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
info fsevents@1.2.13: The platform "linux" is incompatible with this module.
info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@2.1.3: The platform "linux" is incompatible with this module.
info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
warning " > axios-cache-adapter@2.5.0" has incorrect peer dependency "axios@0.18.1".
warning " > karma-webpack@3.0.5" has incorrect peer dependency "webpack@^2.0.0 || ^3.0.0".
warning " > moment-timezone-data-webpack-plugin@1.3.0" has unmet peer dependency "moment-timezone@>= 0.1.0".
warning "workspace-aggregator-c51f1812-65a7-496d-8a71-16c8824cf595 > @instructure/canvas-rce > axe-testcafe@3.0.0" has incorrect peer dependency "axe-core@>=2.2.3 <4".
warning "workspace-aggregator-c51f1812-65a7-496d-8a71-16c8824cf595 > canvas_quizzes > jasmine_react > react@0.10.0" has unmet peer dependency "envify@~1.2.0".
[5/5] Building fresh packages...
$ yarn build:packages && ./script/install_hooks
yarn run v1.22.4
$ yarn workspace-run-serial build:canvas
$ r() { wsrun --fast-exit --exclude-missing --collect-logs --report --serial -c $@; exit $?; } && r build:canvas
i18nliner-canvas has no build:canvas script, skipping missing
@instructure/babel-preset-pretranslated-format-message has no build:canvas script, skipping missing
@instructure/babel-preset-pretranslated-translations-package-format-message has no build:canvas script, skipping missing
@instructure/browserslist-config-canvas-lms has no build:canvas script, skipping missing
jest-moxios-utils has no build:canvas script, skipping missing
old-copy-of-react-14-that-is-just-here-so-if-analytics-is-checked-out-it-doesnt-change-yarn.lock has no build:canvas script, skipping missing
@instructure/ready has no build:canvas script, skipping missing
@instructure/translations has no build:canvas script, skipping missing
canvas_quizzes has no build:canvas script, skipping missing
@instructure/js-utils
$ babel --root-mode upward src -d es & JEST_WORKER_ID=true babel --root-mode upward src -d lib
| Successfully compiled 3 files with Babel (2310ms).
| Successfully compiled 3 files with Babel (2376ms).
@instructure/k5uploader
$ babel --root-mode upward src -d es & JEST_WORKER_ID=true babel --root-mode upward src -d lib
| Successfully compiled 21 files with Babel (1743ms).
| Successfully compiled 21 files with Babel (2055ms).
@instructure/canvas-planner
$ yarn build
$ yarn build:es && yarn build:cjs
$ babel src --out-dir es --ignore '**/__tests__' --quiet
| [babel-plugin-themeable-styles] Custom scoped CSS class names will be removed in 7.0. Please use the default themeable config.
$ JEST_WORKER_ID=true babel src --out-dir lib --ignore '**/__tests__'
| [babel-plugin-themeable-styles] Custom scoped CSS class names will be removed in 7.0. Please use the default themeable config.
| Successfully compiled 95 files with Babel (5369ms).
@instructure/canvas-media
$ yarn run build:es && yarn run build:cjs
$ babel src --out-dir es --ignore '**/__tests__'
| Successfully compiled 17 files with Babel (1826ms).
$ JEST_WORKER_ID=true babel src --out-dir lib --ignore '**/__tests__'
| Successfully compiled 17 files with Babel (2090ms).
@instructure/canvas-rce
$ scripts/build-canvas
| Successfully compiled 241 files with Babel (10688ms).
| Successfully compiled 241 files with Babel (8906ms).
Report:
5 packages finished `build:canvas` successfully: @instructure/js-utils, @instructure/k5uploader, @instructure/canvas-planner, @instructure/canvas-media, @instructure/canvas-rce
9 packages are missing script `build:canvas`: i18nliner-canvas, @instructure/babel-preset-pretranslated-format-message, @instructure/babel-preset-pretranslated-translations-package-format-message, @instructure/browserslist-config-canvas-lms, jest-moxios-utils, old-copy-of-react-14-that-is-just-here-so-if-analytics-is-checked-out-it-doesnt-change-yarn.lock, @instructure/ready, @instructure/translations, canvas_quizzes
Done in 44.89s.
Done in 62.24s.
--> Finished: 'Making sure node_modules are up to date' in 62.629242918
yarn run v1.22.4
$ /var/canvas/node_modules/.bin/gulp rev
[16:26:11] Using gulpfile /var/canvas/gulpfile.js
[16:26:11] Starting 'rev'...
[16:26:19] Finished 'rev' after 8.02 s
Done in 8.69s.
** Invoke css:compile (first_time)
** Execute css:compile
/usr/local/rvm/gems/ruby-2.6.5/gems/ritex-1.0.1/lib/ritex/mathml/entities.rb:55: warning: key "rightleftharpoons" is duplicated and overwritten on line 101
/usr/local/rvm/gems/ruby-2.6.5/gems/ritex-1.0.1/lib/ritex/mathml/entities.rb:178: warning: key "eqslantgtr" is duplicated and overwritten on line 179
/usr/local/rvm/gems/ruby-2.6.5/gems/ritex-1.0.1/lib/ritex/mathml/entities.rb:225: warning: key "ntrianglelefteq" is duplicated and overwritten on line 229
/usr/local/rvm/gems/ruby-2.6.5/gems/ritex-1.0.1/lib/ritex/mathml/entities.rb:244: warning: key "nsupseteq" is duplicated and overwritten on line 245
/usr/local/rvm/gems/ruby-2.6.5/gems/ritex-1.0.1/lib/ritex/mathml/functions.rb:94: warning: key "rowspan" is duplicated and overwritten on line 98
/usr/local/rvm/gems/ruby-2.6.5/gems/ritex-1.0.1/lib/ritex/mathml/functions.rb:93: warning: key "colspan" is duplicated and overwritten on line 99
--> Starting: 'css:compile'
** Invoke brand_configs:write (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute brand_configs:write
1: production:public
yarn run v1.22.4
$ brandable_css
compiled bundles/common.scss new_styles_normal_contrast in 1508 ms
compiled bundles/common.scss new_styles_high_contrast in 1739 ms
compiled bundles/common.scss responsive_layout_normal_contrast in 1974 ms
compiled bundles/common.scss responsive_layout_high_contrast in 2129 ms
compiled bundles/common.scss responsive_layout_normal_contrast_rtl in 2269 ms
compiled bundles/common.scss new_styles_normal_contrast_rtl in 2422 ms
compiled bundles/common.scss responsive_layout_high_contrast_rtl in 2571 ms
compiled bundles/common.scss new_styles_high_contrast_rtl in 2704 ms
Done in 4.17s.
--> Finished: 'css:compile' in 4.618594983000037
** Invoke js:build_client_apps (first_time)
** Execute js:build_client_apps
Building client app 'canvas_quizzes'
yarn install v1.22.4
warning package.json: No license field
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
info fsevents@1.2.13: The platform "linux" is incompatible with this module.
info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@2.1.3: The platform "linux" is incompatible with this module.
info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
warning " > axios-cache-adapter@2.5.0" has incorrect peer dependency "axios@0.18.1".
warning " > karma-webpack@3.0.5" has incorrect peer dependency "webpack@^2.0.0 || ^3.0.0".
warning " > moment-timezone-data-webpack-plugin@1.3.0" has unmet peer dependency "moment-timezone@>= 0.1.0".
warning "workspace-aggregator-75b94dea-e98f-49e0-8f6a-29d2cbcca017 > @instructure/canvas-rce > axe-testcafe@3.0.0" has incorrect peer dependency "axe-core@>=2.2.3 <4".
warning "workspace-aggregator-75b94dea-e98f-49e0-8f6a-29d2cbcca017 > canvas_quizzes > jasmine_react > react@0.10.0" has unmet peer dependency "envify@~1.2.0".
[5/5] Building fresh packages...
Done in 14.41s.
Running 'yarn run build'...
Client app 'canvas_quizzes' was built successfully.
working in 4 processes
--> Starting: 'css:styleguide'
** Invoke css:styleguide (first_time)
** Execute css:styleguide
--> creating styleguide
--> Starting: 'run i18n:generate_js, js:webpack_development, js:webpack_production'
working in 4 processes
--> Starting: 'Generate documentation [yardoc]'
** Invoke doc:api (first_time)
** Execute doc:api
--> Starting: 'i18n:generate_js'
** Invoke i18n:generate_js (first_time)
** Invoke i18n:i18n_environment (first_time)
** Execute i18n:i18n_environment
** Execute i18n:generate_js
# writing file: app/views/info/styleguide.html.erb
--> Finished: 'css:styleguide' in 1.3521107500000085
⣻ Generating /var/canvas/public/doc/api/all_resources.html.................................................................................................⣻ Generating /var/canvas/public/doc/api/all_resources.html.................................................................................................⣻ Generating /var/canvas/public/doc/api/all_resources.html.................................................................................................⣻ Generating /var/canvas/public/doc/api/all_resources.html.................................................................................................⣽ Generating /var/canvas/public/doc/api/all_resources.html.................................................................................................⣽ Generating /var/canvas/public/doc/api/all_resources.html.................................................................................................⣽ Generating /var/canvas/public/doc/api/all_resources.html.................................................................................................⣽ Generating /var/canvas/public/doc/api/all_resources.html.................................................................................................⣾ Generating /var/canvas/public/doc/api/all_resources.html.................................................................................................⣾ Generating /var/canvas/public/doc/api/all_resources.html.................................................................................................⣾ Generating /var/canvas/public/doc/api/all_resources.html.................................................................................................⣾ Generating /var/canvas/public/doc/api/all_resources.html.................................................................................................⣷ Generating /var/canvas/public/doc/api/all_resources.html.................................................................................................⣷ Generating /var/canvas/public/doc/api/all_resources.html.................................................................................................⣷ Generating /var/canvas/public/doc/api/all_resources.html.................................................................................................⣷ Generating /var/canvas/public/doc/api/all_resources.html.................................................................................................⣯ Generating /var/canvas/public/doc/api/all_resources.html.................................................................................................⣯ Generating /var/canvas/public/doc/api/all_resources.html.................................................................................................⣯ Generating /var/canvas/public/doc/api/all_resources.html.................................................................................................⣯ Generating /var/canvas/public/doc/api/all_resources.html.................................................................................................Files: 145
Modules: 0 ( 0 undocumented)
Classes: 137 ( 40 undocumented)
Constants: 0 ( 0 undocumented)
Attributes: 0 ( 0 undocumented)
Methods: 604 ( 17 undocumented)
92.31% documented
API Documentation successfully generated in public/doc/api
See public/doc/api/index.html
--> Finished: 'Generate documentation [yardoc]' in 40.84523435300002
Finished in 16.272 seconds
2954 files, 9116 strings, 0 failures
--> Finished: 'i18n:generate_js' in 64.23698893300002
working in 4 processes
--> Starting: 'js:webpack_development'
** Invoke js:webpack_development (first_time)
** Execute js:webpack_development
--> Building DEVELOPMENT webpack bundles
--> Starting: 'js:webpack_production'
** Invoke js:webpack_production (first_time)
** Execute js:webpack_production
--> Building PRODUCTION webpack bundles
yarn run v1.22.4
yarn run v1.22.4
$ gulp rev 1> /dev/null & NODE_OPTIONS="--max_old_space_size=8192" webpack --color && yarn lint:browser-code
$ NODE_ENV=production gulp rev && NODE_ENV=production NODE_OPTIONS="--max_old_space_size=8192" webpack --color && yarn lint:browser-code
[16:28:44] Using gulpfile /var/canvas/gulpfile.js
[16:28:44] Starting 'rev'...
(node:9814) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
[16:28:53] Finished 'rev' after 9.27 s
(node:9849) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
--> Finished: 'i18n:generate_js' in 64.23698893300002
working in 4 processes
--> Starting: 'js:webpack_development'
** Invoke js:webpack_development (first_time)
** Execute js:webpack_development
--> Building DEVELOPMENT webpack bundles
--> Starting: 'js:webpack_production'
** Invoke js:webpack_production (first_time)
** Execute js:webpack_production
--> Building PRODUCTION webpack bundles
yarn run v1.22.4
yarn run v1.22.4
$ gulp rev 1> /dev/null & NODE_OPTIONS="--max_old_space_size=8192" webpack --color && yarn lint:browser-code
$ NODE_ENV=production gulp rev && NODE_ENV=production NODE_OPTIONS="--max_old_space_size=8192" webpack --color && yarn lint:browser-code
[16:28:44] Using gulpfile /var/canvas/gulpfile.js
[16:28:44] Starting 'rev'...
(node:9814) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
[16:28:53] Finished 'rev' after 9.27 s
(node:9849) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
[ CaseSensitiveModulesWarning: There are multiple modules with names that only differ in casing.
This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.
Use equal casing. Compare these module identifiers:
* /var/canvas/node_modules/moment/locale/en-SG.js
Used by 1 module(s), i. e.
/var/canvas/node_modules/bundles-generated.js
* /var/canvas/node_modules/moment/locale/en-sg.js
Used by 1 module(s), i. e.
/var/canvas/node_modules/bundles-generated.js
at compilation.hooks.seal.tap (/var/canvas/node_modules/webpack/lib/WarnCaseSensitiveModulesPlugin.js:28:34)
at SyncHook.eval (<anonymous>:7:1)
at SyncHook.lazyCompileHook (/var/canvas/node_modules/tapable/lib/Hook.js:154:20)
at Compilation.seal (/var/canvas/node_modules/webpack/lib/Compilation.js:1284:19)
at compilation.finish.err (/var/canvas/node_modules/webpack/lib/Compiler.js:675:18)
at hooks.finishModules.callAsync.err (/var/canvas/node_modules/webpack/lib/Compilation.js:1261:4)
at AsyncSeriesHook.eval [as callAsync] (<anonymous>:15:1)
at AsyncSeriesHook.lazyCompileHook (/var/canvas/node_modules/tapable/lib/Hook.js:154:20)
at Compilation.finish (/var/canvas/node_modules/webpack/lib/Compilation.js:1253:28)
at hooks.make.callAsync.err (/var/canvas/node_modules/webpack/lib/Compiler.js:672:17)
at _err0 (<anonymous>:11:1)
at _addModuleChain (/var/canvas/node_modules/webpack/lib/Compilation.js:1185:12)
at processModuleDependencies.err (/var/canvas/node_modules/webpack/lib/Compilation.js:1097:9)
at process._tickCallback (internal/process/next_tick.js:61:11)
]
Error: webpack build had warnings. Failing.
at plugin (/var/canvas/frontend_build/baseWebpackConfig.js:304:17)
at AsyncSeriesHook.eval [as callAsync] (<anonymous>:9:1)
at AsyncSeriesHook.lazyCompileHook (/var/canvas/node_modules/tapable/lib/Hook.js:154:20)
at emitRecords.err (/var/canvas/node_modules/webpack/lib/Compiler.js:304:22)
at Compiler.emitRecords (/var/canvas/node_modules/webpack/lib/Compiler.js:499:39)
at emitAssets.err (/var/canvas/node_modules/webpack/lib/Compiler.js:298:10)
at hooks.afterEmit.callAsync.err (/var/canvas/node_modules/webpack/lib/Compiler.js:485:14)
at AsyncSeriesHook.eval [as callAsync] (<anonymous>:15:1)
at AsyncSeriesHook.lazyCompileHook (/var/canvas/node_modules/tapable/lib/Hook.js:154:20)
at asyncLib.forEachLimit.err (/var/canvas/node_modules/webpack/lib/Compiler.js:482:27)
at /var/canvas/node_modules/neo-async/async.js:2818:7
at done (/var/canvas/node_modules/neo-async/async.js:3522:9)
at AsyncSeriesHook.eval [as callAsync] (<anonymous>:6:1)
at outputFileSystem.writeFile.err (/var/canvas/node_modules/webpack/lib/Compiler.js:464:33)
at /var/canvas/node_modules/graceful-fs/graceful-fs.js:61:14
at FSReqWrap.args [as oncomplete] (fs.js:140:20)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
rake aborted!
Parallel::UndumpableException: RuntimeError: Error running js:webpack_production:
ABORTING
/var/canvas/lib/tasks/js.rake:50:in `block (2 levels) in <top (required)>'
/usr/local/rvm/gems/ruby-2.6.5/gems/rake-13.0.1/lib/rake/task.rb:281:in `block in execute'
/usr/local/rvm/gems/ruby-2.6.5/gems/rake-13.0.1/lib/rake/task.rb:281:in `each'
/usr/local/rvm/gems/ruby-2.6.5/gems/rake-13.0.1/lib/rake/task.rb:281:in `execute'
/usr/local/rvm/gems/ruby-2.6.5/gems/rake-13.0.1/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/usr/local/rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/monitor.rb:235:in `mon_synchronize'
/usr/local/rvm/gems/ruby-2.6.5/gems/rake-13.0.1/lib/rake/task.rb:199:in `invoke_with_call_chain'
/usr/local/rvm/gems/ruby-2.6.5/gems/rake-13.0.1/lib/rake/task.rb:188:in `invoke'
/var/canvas/lib/tasks/canvas.rake:76:in `block (5 levels) in <top (required)>'
/usr/local/rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/benchmark.rb:308:in `realtime'
/var/canvas/lib/tasks/canvas.rake:7:in `log_time'
/var/canvas/lib/tasks/canvas.rake:76:in `block (4 levels) in <top (required)>'
/usr/local/rvm/gems/ruby-2.6.5/gems/parallel-1.19.1/lib/parallel.rb:509:in `call_with_index'
/usr/local/rvm/gems/ruby-2.6.5/gems/parallel-1.19.1/lib/parallel.rb:360:in `block (2 levels) in work_in_threads'
/usr/local/rvm/gems/ruby-2.6.5/gems/parallel-1.19.1/lib/parallel.rb:518:in `with_instrumentation'
/usr/local/rvm/gems/ruby-2.6.5/gems/parallel-1.19.1/lib/parallel.rb:359:in `block in work_in_threads'
/usr/local/rvm/gems/ruby-2.6.5/gems/par
I have also tried this on VPS with 16GB RAM and 8GB swap. Even on 8GM of RAM, the swap is not used. However, it uses almost all of the 8GM of ram. monitoring using the 'top' command on the linux server.
There some warnings and maybe concern : 9 packages are missing script build:canvas
: i18nliner-canvas, @instructure/babel-preset-pretranslated-format-message, @instructure/babel-preset-pretranslated-translations-package-format-message, @instructure/browserslist-config-canvas-lms, jest-moxios-utils, old-copy-of-react-14-that-is-just-here-so-if-analytics-is-checked-out-it-doesnt-change-yarn.lock, @instructure/ready, @instructure/translations, canvas_quizzes
Also from the trace, this stands out: warning " > karma-webpack@3.0.5" has incorrect peer dependency "webpack@^2.0.0 || ^3.0.0".
In delayed.jobs.yml file I have changed the
to worker_max_job_count: 10
During the process the memory usage looks like this:
KiB Mem : 8008760 total, 5186628 free, 929504 used, 1392628 buff/cache KiB Swap: 8290300 total, 8210428 free, 79872 used. 6758664 avail Mem
This is showing that most of the memory is now free.
Right before the error, the memory usage changes to:
KiB Mem : 8008760 total, 3766108 free, 2837876 used, 1404776 buff/cache KiB Swap: 8290300 total, 8210428 free, 79872 used. 4850292 avail Mem
Still showing that most of the memory is free. I can't see how this is a RAM issue.
I did the following: rm -rf /var/canvas/node_modes yarn install --pre-lockfiles yarn clean cache
The rake proceeded further than before, but still failed:
Hash: 4e6d8f43e5fbbfe2f12e
Version: webpack 4.44.1
Time: 96224ms
Built at: 08/11/2020 6:40:33 PM
Asset Size Chunks Chunk Names
0-c-6ab505ee8d.js 14.4 KiB 0 [emitted] [immutable]
$ es-check es8 ./public/dist/**/*.js
ES-Check: there were 2 ES version matching errors.
ES-Check Error:
----
· erroring file: ./public/dist/webpack-production/account_settings-c-aa82f77eac.js
· error: SyntaxError: Unexpected token (823:135)
· see the printed err.stack below for context
----
SyntaxError: Unexpected token (823:135)
at Parser.pp$4.raise (/var/canvas/node_modules/es-check/node_modules/acorn/dist/acorn.js:2844:13)
at Parser.pp.unexpected (/var/canvas/node_modules/es-check/node_modules/acorn/dist/acorn.js:690:8)
at Parser.pp$3.parseIdent (/var/canvas/node_modules/es-check/node_modules/acorn/dist/acorn.js:2795:10)
at Parser.pp$3.parsePropertyName (/var/canvas/node_modules/es-check/node_modules/acorn/dist/acorn.js:2596:105)
at Parser.pp$3.parseProperty (/var/canvas/node_modules/es-check/node_modules/acorn/dist/acorn.js:2523:8)
at Parser.pp$3.parseObj (/var/canvas/node_modules/es-check/node_modules/acorn/dist/acorn.js:2477:23)
at Parser.pp$2.parseBindingAtom (/var/canvas/node_modules/es-check/node_modules/acorn/dist/acorn.js:1765:19)
at Parser.pp$1.parseVarId (/var/canvas/node_modules/es-check/node_modules/acorn/dist/acorn.js:1241:18)
at Parser.pp$1.parseVar (/var/canvas/node_modules/es-check/node_modules/acorn/dist/acorn.js:1221:12)
at Parser.pp$1.parseVarStatement (/var/canvas/node_modules/es-check/node_modules/acorn/dist/acorn.js:1095:8)
at Parser.pp$1.parseStatement (/var/canvas/node_modules/es-check/node_modules/acorn/dist/acorn.js:848:17)
at Parser.pp$1.parseBlock (/var/canvas/node_modules/es-check/node_modules/acorn/dist/acorn.js:1167:23)
at Parser.pp$3.parseFunctionBody (/var/canvas/node_modules/es-check/node_modules/acorn/dist/acorn.js:2685:22)
at Parser.pp$1.parseFunction (/var/canvas/node_modules/es-check/node_modules/acorn/dist/acorn.js:1283:8)
at Parser.pp$1.parseFunctionStatement (/var/canvas/node_modules/es-check/node_modules/acorn/dist/acorn.js:984:15)
at Parser.pp$1.parseStatement (/var/canvas/node_modules/es-check/node_modules/acorn/dist/acorn.js:836:17)
ES-Check Error:
----
· erroring file: ./public/dist/webpack-production/main-e-5f43f2d189.js
· error: SyntaxError: Unexpected token (690:36)
· see the printed err.stack below for context
----
SyntaxError: Unexpected token (690:36)
at Parser.pp$4.raise (/var/canvas/node_modules/es-check/node_modules/acorn/dist/acorn.js:2844:13)
at Parser.pp.unexpected (/var/canvas/node_modules/es-check/node_modules/acorn/dist/acorn.js:690:8)
at Parser.pp$1.parseTryStatement (/var/canvas/node_modules/es-check/node_modules/acorn/dist/acorn.js:1079:49)
at Parser.pp$1.parseStatement (/var/canvas/node_modules/es-check/node_modules/acorn/dist/acorn.js:844:32)
at Parser.pp$1.parseBlock (/var/canvas/node_modules/es-check/node_modules/acorn/dist/acorn.js:1167:23)
at Parser.pp$1.parseTryStatement (/var/canvas/node_modules/es-check/node_modules/acorn/dist/acorn.js:1067:21)
at Parser.pp$1.parseStatement (/var/canvas/node_modules/es-check/node_modules/acorn/dist/acorn.js:844:32)
at Parser.pp$1.parseBlock (/var/canvas/node_modules/es-check/node_modules/acorn/dist/acorn.js:1167:23)
at Parser.pp$3.parseFunctionBody (/var/canvas/node_modules/es-check/node_modules/acorn/dist/acorn.js:2685:22)
at Parser.pp$1.parseFunction (/var/canvas/node_modules/es-check/node_modules/acorn/dist/acorn.js:1283:8)
at Parser.pp$1.parseFunctionStatement (/var/canvas/node_modules/es-check/node_modules/acorn/dist/acorn.js:984:15)
at Parser.pp$1.parseStatement (/var/canvas/node_modules/es-check/node_modules/acorn/dist/acorn.js:872:19)
at Parser.pp$1.parseBlock (/var/canvas/node_modules/es-check/node_modules/acorn/dist/acorn.js:1167:23)
at Parser.pp$3.parseFunctionBody (/var/canvas/node_modules/es-check/node_modules/acorn/dist/acorn.js:2685:22)
at Parser.pp$1.parseFunction (/var/canvas/node_modules/es-check/node_modules/acorn/dist/acorn.js:1283:8)
at Parser.pp$1.parseFunctionStatement (/var/canvas/node_modules/es-check/node_modules/acorn/dist/acorn.js:984:15)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command
Did anyone get a solution?
list of incorrect peer dependency: warning " > graphiql-explorer@0.4.3" has incorrect peer dependency "graphql@^0.6.0 || ^0.7.0 || ^0.8.0-b || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0". warning " > karma-webpack@3.0.5" has incorrect peer dependency "webpack@^2.0.0 || ^3.0.0". warning " > moment-timezone-data-webpack-plugin@1.1.0" has unmet peer dependency "moment-timezone@>= 0.1.0". warning "workspace-aggregator-2ba4ce7e-c405-4e4c-8998-ab4cebaf1d78 > @instructure/canvas-rce > axe-testcafe@3.0.0" has incorrect peer dependency "axe-core@>=2.2.3 <4". warning "workspace-aggregator-2ba4ce7e-c405-4e4c-8998-ab4cebaf1d78 > canvas_inbox > @storybook/react > react-docgen-typescript-plugin@0.5.2" has unmet peer dependency "typescript@>= 3.x". warning "workspace-aggregator-2ba4ce7e-c405-4e4c-8998-ab4cebaf1d78 > canvas_quizzes > jasmine_react > react@0.10.0" has unmet peer dependency "envify@~1.2.0". warning "workspace-aggregator-2ba4ce7e-c405-4e4c-8998-ab4cebaf1d78 > canvas_inbox > @storybook/addon-essentials > @storybook/addon-docs > @mdx-js/react@1.6.18" has incorrect peer dependency "react@^16.13.1". warning "workspace-aggregator-2ba4ce7e-c405-4e4c-8998-ab4cebaf1d78 > canvas_inbox > @storybook/react > react-docgen-typescript-plugin > react-docgen-typescript@1.20.5" has unmet peer dependency "typescript@>= 3.x". warning "workspace-aggregator-2ba4ce7e-c405-4e4c-8998-ab4cebaf1d78 > canvas_inbox > @storybook/react > react-docgen-typescript-plugin > react-docgen-typescript-loader@3.7.2" has unmet peer dependency "typescript@*".
$ RAILS_ENV=production bundle exec rake db:migrate:predeploy /home/canvas/public_html/vendor/bundle/ruby/2.6.0/gems/soap4r-ruby1.9-2.0.5/lib/soap/mapping/encodedregistry.rb:150: warning: constant ::Fixnum is deprecated /home/canvas/public_html/vendor/bundle/ruby/2.6.0/gems/soap4r-ruby1.9-2.0.5/lib/soap/mapping/encodedregistry.rb:216: warning: constant ::Fixnum is deprecated
RAILS_ENV=production bundle exec rake canvas:compile_assets
Browserslist: caniuse-lite is outdated. Please run next command yarn upgrade
@alissonash I'm asking the same question. Most issues in this repo don't have a solution. Expect it to close w/o one in a few days.
I am having the same issues trying to upgrade to newer versions. Deprecated warnings everywhere, and yarn is very unhappy.
@alissonash I'm asking the same question. Most issues in this repo don't have a solution. Expect it to close w/o one in a few days.
Because they try to push all issues to some random google groups instead of doing it here. They want orgs to use their cloud version, not to self host. The documentation of how to install production should be enough to convince people they dont want you using this repo. And if you do post your issue on the google groups page, all you will get is some random dude offering to fix it for a fee.
Hey @inthebrilliantblue, that's a pretty painful assessment of the community here, sorry for the frustration you've had in getting things to run. You're not wrong that we haven't been great at providing community support here, and it looks like our production wiki is out of date. I'll try to spend some time updating that, but I can tell you that we're using PG 12.5 or 12.6, Ruby 2.6.5, Bundler 2.2.11, Node 14, Yarn 1.19.1. Canvas is large and complex with lots of dependencies, and it's difficult to provide support for everyone's unique setup, which is why we've encouraged people with operational issues to use the google group list, to try to encourage other's who have had similar problems to chime in and help.
It looks like this thread has a mixture of many different issues dispersed in it, but let me take a stab at addressing some:
It looks like the original post by @rizkyekoputra WAS a RAM issue. I'm guessing a little bit here because the output isn't clear, but Killed error Command failed with exit code 137.
is a pretty good indication of that. And to answer the original question, there is not an official production docker image at this time. It looks like that was answered at the time.
The second issue by @rippledj appears to be a case-sensitive filesystem issue, based on this output:
[ CaseSensitiveModulesWarning: There are multiple modules with names that only differ in casing.
This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.
Use equal casing. Compare these module identifiers:
* /var/canvas/node_modules/moment/locale/en-SG.js
Used by 1 module(s), i. e.
/var/canvas/node_modules/bundles-generated.js
* /var/canvas/node_modules/moment/locale/en-sg.js
Used by 1 module(s), i. e.
/var/canvas/node_modules/bundles-generated.js
The rest of the replies here have said "same issue" without providing any output, so it's difficult to tell whether they're related to either of the above or something else different.
You also mentioned deprecation warnings for ruby constants, which we definitely have some of from old dependencies who haven't updated recently, but those shouldn't affect the process.
Hopefully that helps, or if you have a different yarn issue, let me know.
I am having the same issue.
Summary:
I got this error UndumpableException: RuntimeError: Error running js:webpack_production when docker build for production purpose
Steps to reproduce:
docker-compose up -d --build
Expected behavior:
No error
Actual behavior:
Additional notes:
I am using macOS Mojave 10.14.3
Question : There is any production start with docker??