# Compiling issue under ubuntu:20.04

**URL:** <https://mediasoup.discourse.group/t/compiling-issue-under-ubuntu-20-04/3112>\
**Category:** mediasoup libraries\
**Created:** [July 30, 2021, 8:40am UTC](https://mediasoup.discourse.group/t/compiling-issue-under-ubuntu-20-04/3112 "2021-07-30T08:40:13Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![balazskreith](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/balazskreith/32/1130_2.png) [@balazskreith](https://mediasoup.discourse.group/u/balazskreith)\
**Post date:** [July 30, 2021, 8:40am UTC](https://mediasoup.discourse.group/t/compiling-issue-under-ubuntu-20-04/3112/1 "2021-07-30T08:40:13Z")

</div>

Hi,

Not sure what I am doing wrong, less sure about a bug so I have the following output when I try to run a server app using mediasoup:

```auto
mediasoup createWorker() +0ms
  mediasoup:Worker constructor() +0ms
  mediasoup:Worker spawning worker process: /node_modules/mediasoup/worker/out/Release/mediasoup-worker --logLevel=error --rtcMinPort=10000 --rtcMaxPort=10100 +0ms
  mediasoup:Channel constructor() +0ms
  mediasoup:PayloadChannel constructor() +0ms
  mediasoup:ERROR:Worker (stderr) /node_modules/mediasoup/worker/out/Release/mediasoup-worker: 1: �������H __PAGEZEROx__ TEXT@6@6 __text__ TEXT@: not found +0ms
  mediasoup:ERROR:Worker (stderr) /node_modules/mediasoup/worker/out/Release/mediasoup-worker: 2: �-@
                                                                                                     � __stubs__ TEXT: not found +1ms
  mediasoup:ERROR:Worker (stderr) /node_modules/mediasoup/worker/out/Release/mediasoup-worker: 3: .b: not found +0ms
  mediasoup:ERROR:Worker (stderr) /node_modules/mediasoup/worker/out/Release/mediasoup-worker: 5: Syntax error: word unexpected (expecting ")") +0ms
  mediasoup:Channel Producer Channel ended by the worker process +7ms
  mediasoup:Channel Consumer Channel ended by the worker process +1ms
  mediasoup:PayloadChannel Producer PayloadChannel ended by the worker process +8ms
  mediasoup:PayloadChannel Consumer PayloadChannel ended by the worker process +0ms
  mediasoup:Worker close() +16ms
  mediasoup:Channel close() +2ms
  mediasoup:PayloadChannel close() +3ms
  mediasoup:ERROR:Worker worker process failed unexpectedly [pid:37, code:2, signal:null] +0ms
[2021-07-30T11:21:50.332] [ERROR] server - Error occurred while server is being started Error: [pid:37, code:2, signal:null]
    at ChildProcess.Worker._child.on (/node_modules/mediasoup/lib/Worker.js:122:43)
    at ChildProcess.emit (events.js:198:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)

```

seems like the compiled bin file is problematic. lead me to the conclusion that I compile it somehow wrong.

The environment:  
I try run the server app inside a docker image: `FROM ubuntu:20.04`  
mediasoup version: 3.8.0  
node v10.19.0  
gcc 9.3.0  
npm 6.14.4

Any idea what I miss?

---

<div class="post-metadata">

**Author:** ![jmillan](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/jmillan/32/9_2.png) [@jmillan](https://mediasoup.discourse.group/u/jmillan)\
**Post date:** [July 30, 2021, 9:00am UTC](https://mediasoup.discourse.group/t/compiling-issue-under-ubuntu-20-04/3112/2 "2021-07-30T09:00:37Z")

</div>

Can you please follow the guidelines here to get the core dump and open a GH issue as indicated there?

> **[mediasoup :: Support](https://mediasoup.org/support/)**
>
> Cutting Edge WebRTC Video Conferencing

---

<div class="post-metadata">

**Author:** ![balazskreith](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/balazskreith/32/1130_2.png) [@balazskreith](https://mediasoup.discourse.group/u/balazskreith)\
**Post date:** [July 30, 2021, 1:19pm UTC](https://mediasoup.discourse.group/t/compiling-issue-under-ubuntu-20-04/3112/3 "2021-07-30T13:19:14Z")

</div>

Thank you for your quick reply.

I was/am not sure if it is really an issue or I miss something obvious at first glance for someone, but let’s spread the problem forward as you requested:

> <https://github.com/versatica/mediasoup/issues/630>
>
> \### Running environment
> 
> \- Operating system: Mac OS Big Sur 11.4
> \- Node vers…ion: 12.0.0
> \- npm version: 6.9.0
> \- gcc/clang version: Apple clang version 12.0.0 (clang-1200.0.32.29)
> \- mediasoup version: 3.8.0
> \- mediasoup-client version: not relevant here
> 
> \#### Docker environment
> - Operating system: ubuntu:12.04
> - node: 10.19.0
> - npm 6.14.4
> - gcc: (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
> 
> 
> \### Issue description
> 
> Wanted to run a server application loading mediasoup in docker using base image \`ubuntu:20.04\`.  
> When I launch the docker container it dumps:
> 
> \`\`\`shell
> 2021-07-30T13:05:44.208Z mediasoup createWorker()
> 2021-07-30T13:05:44.209Z mediasoup:Worker constructor()
> 2021-07-30T13:05:44.210Z mediasoup:Worker spawning worker process: /app/node\_modules/mediasoup/worker/out/Release/mediasoup-worker --logLevel=error --rtcMinPort=10000 --rtcMaxPort=10100
> 2021-07-30T13:05:44.217Z mediasoup:Channel constructor()
> 2021-07-30T13:05:44.218Z mediasoup:PayloadChannel constructor()
> 2021-07-30T13:05:44.223Z mediasoup:ERROR:Worker (stderr) /app/node\_modules/mediasoup/worker/out/Release/mediasoup-worker: 1: �������H\_\_PAGEZEROx\_\_TEXT@6@6\_\_text\_\_TEXT@: not found
> 2021-07-30T13:05:44.223Z mediasoup:ERROR:Worker (stderr) /app/node\_modules/mediasoup/worker/out/Release/mediasoup-worker: 2: �-@
> �\_\_stubs\_\_TEXT: not found
> 2021-07-30T13:05:44.223Z mediasoup:ERROR:Worker (stderr) /app/node\_modules/mediasoup/worker/out/Release/mediasoup-worker: 3: .b: not found
> 2021-07-30T13:05:44.223Z mediasoup:ERROR:Worker (stderr) /app/node\_modules/mediasoup/worker/out/Release/mediasoup-worker: 5: Syntax error: word unexpected (expecting ")")
> 2021-07-30T13:05:44.224Z mediasoup:Channel Producer Channel ended by the worker process
> 2021-07-30T13:05:44.224Z mediasoup:Channel Consumer Channel ended by the worker process
> 2021-07-30T13:05:44.224Z mediasoup:PayloadChannel Producer PayloadChannel ended by the worker process
> 2021-07-30T13:05:44.225Z mediasoup:PayloadChannel Consumer PayloadChannel ended by the worker process
> 2021-07-30T13:05:44.226Z mediasoup:Worker close()
> 2021-07-30T13:05:44.226Z mediasoup:Channel close()
> 2021-07-30T13:05:44.228Z mediasoup:PayloadChannel close()
> 2021-07-30T13:05:44.228Z mediasoup:ERROR:Worker worker process failed unexpectedly \[pid:16, code:2, signal:null\]
> \[2021-07-30T16:05:44.229\] \[ERROR\] server - Error occurred while server is being started Error: \[pid:16, code:2, signal:null\]
> at ChildProcess.Worker.\_child.on (/app/node\_modules/mediasoup/lib/Worker.js:122:43)
> at ChildProcess.emit (events.js:198:13)
> at Process.ChildProcess.\_handle.onexit (internal/child\_process.js:248:12)
> \`\`\`
> 
> Tried to got core dump, but did not get any (maybe because it does not find the entrypoint of the worker to spawn?! 
> 
> Started the discussion \[here\](https://mediasoup.discourse.group/t/compiling-issue-under-ubuntu-20-04/3112), because I doubt if it is an issue popping out or I miss something.

---

<div class="post-metadata">

**Author:** ![nazar-pc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/nazar-pc/32/369_2.png) [@nazar-pc](https://mediasoup.discourse.group/u/nazar-pc)\
**Post date:** [July 30, 2021, 1:21pm UTC](https://mediasoup.discourse.group/t/compiling-issue-under-ubuntu-20-04/3112/4 "2021-07-30T13:21:58Z")

</div>

I have a suspicion that due to being on macOS you might have compiled worker on macOS and now trying to run it under Docker. Make sure you don’t include `node_modules` into your Docker context. Can’t tell much more without Dockerfile.

---

<div class="post-metadata">

**Author:** ![nazar-pc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/nazar-pc/32/369_2.png) [@nazar-pc](https://mediasoup.discourse.group/u/nazar-pc)\
**Post date:** [July 30, 2021, 1:27pm UTC](https://mediasoup.discourse.group/t/compiling-issue-under-ubuntu-20-04/3112/5 "2021-07-30T13:27:49Z")

</div>

From Dockerfile on GitHub:

```auto
RUN npm install -g node-gyp
COPY ["package.json", "package-lock.json*", "./"]
RUN npm install
COPY . .

```

This is precisely your problem: you build worker under Ubuntu and then replace it with one built on macOS. Obviously those are different executables.

1. Never use `COPY . .`, copy specific files and directories you need
2. Always include `.dockerignore` and put things like `node_modules` into it
3. Not sure where you’ve got `npm install -g node-gyp` from, but it is not needed here

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [July 30, 2021, 1:41pm UTC](https://mediasoup.discourse.group/t/compiling-issue-under-ubuntu-20-04/3112/6 "2021-07-30T13:41:26Z")

</div>

Good finding. I’ll close the issue in GH.

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [July 30, 2021, 1:42pm UTC](https://mediasoup.discourse.group/t/compiling-issue-under-ubuntu-20-04/3112/7 "2021-07-30T13:42:20Z")

</div>

Oh it was already 🙂
