tycrek / ass

The simple self-hosted ShareX server
ISC License
655 stars 53 forks source link

[BUG] Docker: TypeScript compiler runs out of memory #143

Closed SerenModz21 closed 2 years ago

SerenModz21 commented 2 years ago

Is there an existing Issue for this bug?

Expected behavior

The Typescript compiler should compile and continue running the docker container

Actual behavior

The Typescript compiler fails to compile and exits the process

Steps to reproduce

  1. Clone the repo with git clone https://github.com/tycrek/ass.git && cd ass/
  2. Run the install script for the OS of choice I tried the shell script with git bash and the bash script with command prompt

Logs (optional)

C:\path\ass>C:\path\ass\install\docker-windows.bat
Installing ass-docker for Windows...
Continuing will run docker compose. Continue? (Press Ctrl+C to abort)
Press any key to continue . . .
Running setup...
[+] Building 49.9s (10/10) FINISHED
 => [internal] load build definition from Dockerfile                                                               0.0s
 => => transferring dockerfile: 812B                                                                               0.0s
 => [internal] load .dockerignore                                                                                  0.0s
 => => transferring context: 2B                                                                                    0.0s
 => [internal] load metadata for docker.io/library/node:16.14.0                                                    1.0s
 => [auth] library/node:pull token for registry-1.docker.io                                                        0.0s
 => [1/5] FROM docker.io/library/node:16.14.0@sha256:61b6cc81ecc3f94f614dca6bfdc5262d15a6618f7aabfbfc6f9f05c935ee  0.0s
 => [internal] load build context                                                                                  0.1s
 => => transferring context: 1.99MB                                                                                0.0s
 => CACHED [2/5] WORKDIR /opt/ass/                                                                                 0.0s
 => [3/5] COPY . ./                                                                                                0.0s
 => [4/5] RUN mkdir -p /opt/ass/uploads/thumbnails/ &&     mkdir -p /opt/ass/share/ &&     touch /opt/ass/config.  0.6s
 => ERROR [5/5] RUN npm i --save-dev &&     npm run build                                                         48.0s
------
 > [5/5] RUN npm i --save-dev &&     npm run build:
#0 11.02 npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
#0 20.27 npm WARN deprecated uuid@3.3.2: 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.
#0 35.49
#0 35.49 added 550 packages, and audited 551 packages in 35s
#0 35.49
#0 35.49 52 packages are looking for funding
#0 35.49   run `npm fund` for details
#0 35.50
#0 35.50 14 vulnerabilities (7 moderate, 7 high)
#0 35.50
#0 35.50 To address issues that do not require attention, run:
#0 35.50   npm audit fix
#0 35.50
#0 35.50 To address all issues possible (including breaking changes), run:
#0 35.50   npm audit fix --force
#0 35.50
#0 35.50 Some issues need review, and may require choosing
#0 35.50 a different dependency.
#0 35.50
#0 35.50 Run `npm audit` for details.
#0 35.50 npm notice
#0 35.50 npm notice New minor version of npm available! 8.3.1 -> 8.17.0
#0 35.50 npm notice Changelog: <https://github.com/npm/cli/releases/tag/v8.17.0>
#0 35.50 npm notice Run `npm install -g npm@8.17.0` to update!
#0 35.50 npm notice
#0 35.90
#0 35.90 > ass@0.11.0-rc.1 build
#0 35.90 > tsc
#0 35.90
#0 47.74
#0 47.74 <--- Last few GCs --->
#0 47.74
#0 47.74 [81:0x6700a00]    11346 ms: Scavenge 483.6 (493.5) -> 483.0 (493.7) MB, 9.9 / 0.0 ms  (average mu = 0.185, current mu = 0.155) allocation failure
#0 47.74
#0 47.74
#0 47.74 <--- JS stacktrace --->
#0 47.74
#0 47.74 FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
#0 47.76  1: 0xb09980 node::Abort() [node]
#0 47.76  2: 0xa1c235 node::FatalError(char const*, char const*) [node]
#0 47.76  3: 0xcf77be v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
#0 47.76  4: 0xcf7b37 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
#0 47.76  5: 0xeaf3d5  [node]
#0 47.76  6: 0xeafeb6  [node]
#0 47.76  7: 0xebe3de  [node]
#0 47.76  8: 0xebee20 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
#0 47.76  9: 0xec1d15 v8::internal::Heap::HandleGCRequest() [node]
#0 47.76 10: 0xe4f3b7 v8::internal::StackGuard::HandleInterrupts() [node]
#0 47.76 11: 0x11fb775 v8::internal::Runtime_StackGuard(int, unsigned long*, v8::internal::Isolate*) [node]
#0 47.76 12: 0x15f0a99  [node]
#0 47.80 Aborted
------
failed to solve: executor failed running [/bin/sh -c npm i --save-dev &&     npm run build]: exit code: 134
ass-docker for Windows installed!
Run the following to view commands:

C:\path\ass>

ass version

0.11.0-rc.1 (package.json version)

Deployment

Docker

Operating system

Windows 10 Pro 21H1

Docker version 20.10.17, build 100c701

docker-compose version 1.29.2, build 5becea4c but i also tried docker-compose v2.7.0

Node version

16.14.0 (node version from dockerfile)

samip5 commented 2 years ago

Docker for Desktop aka using Hyper-V?

SerenModz21 commented 2 years ago

yes but i use the wsl 2 based engine instead of hyper-v

samip5 commented 2 years ago

Have you tweaked the memory limit on Docker Desktop settings?

SerenModz21 commented 2 years ago

no. i've always kept the default resource settings but i guess the only way to fix it would be to either increase memory or just give it a try without docker