Gitlab EE 17.0.0, Asset compilation fails with JavaScript heap out of memory
I'm the maintainer of the Gitlab package for FreeBSD. I shortly provided also a package for the Gitlab EE version, but while compiling the assets it fails (the CE version works fine).
The command that is used to compile the assets are:
su -l git -c "cd /usr/local/www/gitlab && RAILS_ENV=production NODE_ENV=production USE_DB=false SKIP_STORAGE_VALIDATION=true NODE_OPTIONS='--max_old_space_size=3584' bundle exec rake gitlab:assets:compile"
The last lines of the error message are:
...
I, [2024-05-22T15:33:35.424707 #5502] INFO -- : Writing /usr/local/www/gitlab/public/assets/illustrations/third-party-logos/knowbe4-b57a62cee73ab616bcfd7c0082c5f635de763f76a9dbdc8430455d16dc322445.svg
I, [2024-05-22T15:33:35.424869 #5502] INFO -- : Writing /usr/local/www/gitlab/public/assets/illustrations/third-party-logos/knowbe4-b57a62cee73ab616bcfd7c0082c5f635de763f76a9dbdc8430455d16dc322445.svg.gz
I, [2024-05-22T15:33:35.426689 #5502] INFO -- : Writing /usr/local/www/gitlab/public/assets/illustrations/third-party-logos/kontra-dd9ba1366296fbd1773a988883585160261a93a28e4951891834c9aca52aa10d.svg
I, [2024-05-22T15:33:35.426860 #5502] INFO -- : Writing /usr/local/www/gitlab/public/assets/illustrations/third-party-logos/kontra-dd9ba1366296fbd1773a988883585160261a93a28e4951891834c9aca52aa10d.svg.gz
I, [2024-05-22T15:33:35.429022 #5502] INFO -- : Writing /usr/local/www/gitlab/public/assets/illustrations/third-party-logos/linux-eb0c91a8c971bca2565489748050317fb74353efc6cfb0d43c98b1fb5dd4987a.svg
I, [2024-05-22T15:33:35.429149 #5502] INFO -- : Writing /usr/local/www/gitlab/public/assets/illustrations/third-party-logos/linux-eb0c91a8c971bca2565489748050317fb74353efc6cfb0d43c98b1fb5dd4987a.svg.gz
I, [2024-05-22T15:33:35.431024 #5502] INFO -- : Writing /usr/local/www/gitlab/public/assets/illustrations/third-party-logos/pelican-566b41ed25915a5b9e8e790c6a0f81f406c16d390ee84f12b959d29244519774.svg
I, [2024-05-22T15:33:35.431208 #5502] INFO -- : Writing /usr/local/www/gitlab/public/assets/illustrations/third-party-logos/pelican-566b41ed25915a5b9e8e790c6a0f81f406c16d390ee84f12b959d29244519774.svg.gz
I, [2024-05-22T15:33:35.433587 #5502] INFO -- : Writing /usr/local/www/gitlab/public/assets/illustrations/third-party-logos/salesforce-6af88fc4fc2cc2b0d71a242e73646822ab238693fc5196283222759f12bb0bca.png
I, [2024-05-22T15:33:35.435135 #5502] INFO -- : Writing /usr/local/www/gitlab/public/assets/illustrations/third-party-logos/secure_code_warrior-69cd89dd3f2fd6ccc1647096968528fb5bbfbdde05f23517f2f0f73e409fbae3.svg
I, [2024-05-22T15:33:35.435251 #5502] INFO -- : Writing /usr/local/www/gitlab/public/assets/illustrations/third-party-logos/secure_code_warrior-69cd89dd3f2fd6ccc1647096968528fb5bbfbdde05f23517f2f0f73e409fbae3.svg.gz
I, [2024-05-22T15:33:35.437741 #5502] INFO -- : Writing /usr/local/www/gitlab/public/assets/illustrations/third-party-logos/siemens-9c0b1188b7c1b15f5d4d3388b79cc38dc957e4a7f314bdb594a5b3354f60f113.svg
I, [2024-05-22T15:33:35.437877 #5502] INFO -- : Writing /usr/local/www/gitlab/public/assets/illustrations/third-party-logos/siemens-9c0b1188b7c1b15f5d4d3388b79cc38dc957e4a7f314bdb594a5b3354f60f113.svg.gz
I, [2024-05-22T15:33:35.447850 #5502] INFO -- : Writing /usr/local/www/gitlab/public/assets/illustrations/third-party-logos/wish-0e08a5eaa6975a5e7d8c5d10a268cf586c09c14f05dd80d169202ac86df837d6.svg
I, [2024-05-22T15:33:35.448195 #5502] INFO -- : Writing /usr/local/www/gitlab/public/assets/illustrations/third-party-logos/wish-0e08a5eaa6975a5e7d8c5d10a268cf586c09c14f05dd80d169202ac86df837d6.svg.gz
I, [2024-05-22T15:33:35.449744 #5502] INFO -- : Writing /usr/local/www/gitlab/public/assets/illustrations/user-not-logged-in-2990a0fe75ca0eebe29d4654a6a00649eda7c706dbdb68a4ff6442cb0e3f6da0.svg
I, [2024-05-22T15:33:35.450059 #5502] INFO -- : Writing /usr/local/www/gitlab/public/assets/illustrations/user-not-logged-in-2990a0fe75ca0eebe29d4654a6a00649eda7c706dbdb68a4ff6442cb0e3f6da0.svg.gz
I, [2024-05-22T15:33:35.451393 #5502] INFO -- : Writing /usr/local/www/gitlab/public/assets/illustrations/web-ide_promotion-e704a1a4d8d093ecf9779b7791ea886dfbba5405cf1e92f41c74e8e86d7a9144.svg
I, [2024-05-22T15:33:35.451588 #5502] INFO -- : Writing /usr/local/www/gitlab/public/assets/illustrations/web-ide_promotion-e704a1a4d8d093ecf9779b7791ea886dfbba5405cf1e92f41c74e8e86d7a9144.svg.gz
I, [2024-05-22T15:33:35.453279 #5502] INFO -- : Writing /usr/local/www/gitlab/public/assets/illustrations/welcome/ee_trial-ab482e3e17d32392531f8f171a4a364a67d4179935d03eb7bdbdb58983290b7f.svg
I, [2024-05-22T15:33:35.453522 #5502] INFO -- : Writing /usr/local/www/gitlab/public/assets/illustrations/welcome/ee_trial-ab482e3e17d32392531f8f171a4a364a67d4179935d03eb7bdbdb58983290b7f.svg.gz
`rake:assets:precompile` finished in 106.653746307 seconds
yarn run v1.22.19
$ NODE_OPTIONS="${NODE_OPTIONS:=--max-old-space-size=5120}" webpack --config config/webpack.config.js
IncrementalWebpackCompiler: Status – disabled
`isModuleDeclaration` has been deprecated, please migrate to `isImportOrExportDeclaration`
at isModuleDeclaration (/usr/local/www/gitlab/node_modules/@babel/types/lib/validators/generated/index.js:2748:35)
at PluginPass.Program (/usr/local/www/gitlab/node_modules/babel-plugin-lodash/lib/index.js:102:44)
Warning: fragment with name MilestoneFragment already exists.
graphql-tag enforces all fragment names across your application to be unique; read more about
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names
Warning: fragment with name MilestoneFragment already exists.
graphql-tag enforces all fragment names across your application to be unique; read more about
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names
Warning: fragment with name TimelogFragment already exists.
graphql-tag enforces all fragment names across your application to be unique; read more about
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names
Warning: fragment with name AuditEventStreamingHeaderFragment already exists.
graphql-tag enforces all fragment names across your application to be unique; read more about
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names
Warning: fragment with name WorkItemWidgets already exists.
graphql-tag enforces all fragment names across your application to be unique; read more about
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names
Warning: fragment with name Issue already exists.
graphql-tag enforces all fragment names across your application to be unique; read more about
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names
Warning: fragment with name BoardListFragment already exists.
graphql-tag enforces all fragment names across your application to be unique; read more about
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names
Warning: fragment with name BaseEpic already exists.
graphql-tag enforces all fragment names across your application to be unique; read more about
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names
[exports-replacer]: @swagger-api/apidom-reference/configuration/empty => @swagger-api/apidom-reference/es/configuration/empty.mjs
[exports-replacer]: @swagger-api/apidom-reference/configuration/empty => @swagger-api/apidom-reference/es/configuration/empty.mjs
[exports-replacer]: @swagger-api/apidom-reference/dereference/strategies/openapi-3-1 => @swagger-api/apidom-reference/es/dereference/strategies/openapi-3-1/index.mjs
[exports-replacer]: @swagger-api/apidom-reference/configuration/empty => @swagger-api/apidom-reference/es/configuration/empty.mjs
[exports-replacer]: @swagger-api/apidom-reference/dereference/strategies/openapi-3-1/selectors/uri => @swagger-api/apidom-reference/es/dereference/strategies/openapi-3-1/selectors/uri.mjs
[exports-replacer]: @swagger-api/apidom-reference/dereference/strategies/openapi-3-1/selectors/$anchor => @swagger-api/apidom-reference/es/dereference/strategies/openapi-3-1/selectors/$anchor.mjs
[exports-replacer]: @swagger-api/apidom-reference/dereference/strategies/openapi-3-1 => @swagger-api/apidom-reference/es/dereference/strategies/openapi-3-1/index.mjs
[exports-replacer]: @swagger-api/apidom-reference/configuration/empty => @swagger-api/apidom-reference/es/configuration/empty.mjs
[exports-replacer]: @swagger-api/apidom-reference/configuration/empty => @swagger-api/apidom-reference/es/configuration/empty.mjs
[exports-replacer]: @swagger-api/apidom-reference/dereference/strategies/openapi-3-1 => @swagger-api/apidom-reference/es/dereference/strategies/openapi-3-1/index.mjs
[exports-replacer]: @swagger-api/apidom-reference/configuration/empty => @swagger-api/apidom-reference/es/configuration/empty.mjs
[exports-replacer]: @swagger-api/apidom-reference/configuration/empty => @swagger-api/apidom-reference/es/configuration/empty.mjs
[exports-replacer]: @swagger-api/apidom-reference/configuration/empty => @swagger-api/apidom-reference/es/configuration/empty.mjs
[exports-replacer]: @swagger-api/apidom-reference/resolve/strategies/openapi-3-1 => @swagger-api/apidom-reference/es/resolve/strategies/openapi-3-1/index.mjs
[exports-replacer]: @swagger-api/apidom-reference/parse/parsers/binary => @swagger-api/apidom-reference/es/parse/parsers/binary/index-browser.mjs
[exports-replacer]: @swagger-api/apidom-reference/configuration/empty => @swagger-api/apidom-reference/es/configuration/empty.mjs
[exports-replacer]: @swagger-api/apidom-reference/configuration/empty => @swagger-api/apidom-reference/es/configuration/empty.mjs
[exports-replacer]: @swagger-api/apidom-reference/configuration/empty => @swagger-api/apidom-reference/es/configuration/empty.mjs
[exports-replacer]: @swagger-api/apidom-reference/configuration/empty => @swagger-api/apidom-reference/es/configuration/empty.mjs
Warning: fragment with name Label already exists.
graphql-tag enforces all fragment names across your application to be unique; read more about
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names
Warning: fragment with name IssueFragment already exists.
graphql-tag enforces all fragment names across your application to be unique; read more about
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names
Warning: fragment with name Project already exists.
graphql-tag enforces all fragment names across your application to be unique; read more about
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names
Warning: fragment with name Group already exists.
graphql-tag enforces all fragment names across your application to be unique; read more about
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names
Warning: fragment with name OrganizationFragment already exists.
graphql-tag enforces all fragment names across your application to be unique; read more about
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names
Warning: fragment with name ContactFragment already exists.
graphql-tag enforces all fragment names across your application to be unique; read more about
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names
<--- Last few GCs --->
[5632:0x3cd945b27180] 1109176 ms: Scavenge 3455.9 (3579.2) -> 3450.4 (3579.2) MB, 13.99 / 0.00 ms (average mu = 0.364, current mu = 0.357) allocation failure;
[5632:0x3cd945b27180] 1109214 ms: Scavenge 3462.6 (3581.5) -> 3454.9 (3580.1) MB, 13.43 / 0.00 ms (average mu = 0.364, current mu = 0.357) allocation failure;
[5632:0x3cd945b27180] 1109243 ms: Scavenge 3468.5 (3580.5) -> 3457.4 (3580.4) MB, 12.53 / 0.00 ms (average mu = 0.364, current mu = 0.357) allocation failure;
<--- JS stacktrace --->
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----
1: 0x17c58b5 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [/usr/local/bin/node]
2: 0x199e747 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/usr/local/bin/node]
3: 0x1b7dc35 v8::internal::Heap::FatalProcessOutOfMemory(char const*) [/usr/local/bin/node]
4: 0x1b81a28 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [/usr/local/bin/node]
5: 0x1b7e34d v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::internal::GarbageCollectionReason, char const*) [/usr/local/bin/node]
6: 0x1b7c03e v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/local/bin/node]
7: 0x1b7b588 v8::internal::Heap::HandleGCRequest() [/usr/local/bin/node]
8: 0x1b0dfa7 v8::internal::StackGuard::HandleInterrupts() [/usr/local/bin/node]
error Command failed with signal "SIGABRT".
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: Unable to compile webpack production bundle.
Thanks for any help to get that sorted out, so I can also provide a stable Gitlab EE package for FreeBSD.