Open medemi68 opened 6 months ago
What do your package.json
and package-lock.json
files look like? This is a known issue that I think should be fixed in the next release (sorry about that taking so long oops), just making sure nothing is out-of-the-ordinary there
I am also experiencing this. Here is my package.json:
{
"name": "test-peer",
"version": "1.0.0",
"description": "",
"main": "jest.config.js",
"scripts": {
"build": "tsc",
"start": "node dist/index.js",
"dev": "ts-node src/index.ts",
"test": "jest"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
},
"dependencies": {
"@roamhq/wrtc": "^0.8.0",
"@types/node": "^22.5.1",
"@types/webrtc": "^0.0.43",
"socket.io-client": "^4.7.5",
"ts-results-es": "^4.2.0",
"@types/jest": "^29.5.12",
"jest": "^29.7.0",
"ts-jest": "^29.2.5",
"ts-node": "^10.9.2",
"typescript": "^5.5.4"
}
}
@kkingsbe it looks like you have the version that includes the docker search path fix I thought would work, darn...
I'm guessing you might be building this docker image on an ARM64 host? What happens if you add an explicit dependency on @roamhq/wrtc-linux-x64
. Not too experienced in figuring out why docker isn't picking up the right binary sorry
I ended up finding a workaround to just not use docker for now (was trying to debug an issue relating to ICE connection discovery and wanted to see if it was due to being on the same NAT, hence the need for Docker :). Ended up just finding another way to resolve it)
Hi, I suffered the same but the error is a bit misleading.
I made the error more realistic adding a console.log in @roamhq/wrtc/lib/binding.js
let succeeded = false;
for (const path of paths_to_try) {
try {
console.log(path)
module.exports = require(path);
console.log(module.exports, 'here')
succeeded = true;
break;
} catch (error) {
console.log(error)
}
}
after that I saw that I had an error with a library
Error: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /workspace/node_modules/@roamhq/wrtc-linux-x64/wrtc.node)
Ah! Thanks for debugging that @DavidGOrtega.
As explained in https://github.com/WonderInventions/node-webrtc/issues/21#issuecomment-2334871875, I've been having trouble getting libwebrtc to use a lower GLIBC version, due to its use of a bundled compiler toolchain. For now I would recommend using a different Docker base image as the simplest path forward for anyone having trouble with this.
as a reference node:18-bookworm-slim
is apparently compatible. I need to do some tests but at least the code runs.
Effectively node:18-bookworm-slim
is working perfectly.
node:18-bookworm-slim
This doesn't work for me unfortunately running on apple silicon (arm) mac machine and there the package works fine but on linux/docker container also on the same machine doesn't work, any recommendations would be great
Hi @Moe03; what's the error you're seeing? Does the patch in https://github.com/WonderInventions/node-webrtc/issues/16#issuecomment-2408188136 help clarify things any?
Hey @duvallj ty for your help, No I think the issue im facing is a bit different where on my dev env everything is working fine, but when I deploy to a docker container it seems to always output this error whenever it tries to connect to ice servers:
ICE Candidate Error: RTCPeerConnectionIceErrorEvent {
type: 'icecandidateerror',
address: '127.0.0.x',
port: '',
url: 'turn:relay7.expressturn.com:3478?transport=udp',
errorCode: 701,
errorText: 'TURN allocate request timed out.',
target: RTCPeerConnection {
_listeners: {},
canTrickleIceCandidates: [Getter],
connectionState: [Getter],
currentLocalDescription: [Getter],
localDescription: [Getter],
pendingLocalDescription: [Getter],
currentRemoteDescription: [Getter],
remoteDescription: [Getter],
pendingRemoteDescription: [Getter],
signalingState: [Getter],
sctp: [Getter],
iceGatheringState: [Getter],
iceConnectionState: [Getter],
onconnectionstatechange: [Function (anonymous)],
ondatachannel: null,
oniceconnectionstatechange: null,
onicegatheringstatechange: null,
AudioStreamwebrtcHandler disconnected
connection state changed: [object Object]
STOPPED WEBRTC STREAMING
onnegotiationneeded: null,
onsignalingstatechange: null,
onicecandidate: [Function (anonymous)],
onicecandidateerror: [Function (anonymous)],
ontrack: [Function: bound handleOnTrack]
}
}
Address: 127.0.0.x
Port:
Error Code: 701
Error Text: TURN allocate request timed out.
While in the dev environment it's working perfectly fine without issues, I also remember deploying it before and it was working perfectly but then neither that version works now or any other docker based container.
That said I've made it work on my mac's docker by enabling these options and I tried doing the same with linux but without luck unfortunately
I think this may be related to the fact im using a proxy on top of the docker container, specfically coolify: https://coolify.io/ but i've also added in the traefic config labels to allow UDP traffic but also it seems to always output that error, have debugged a lot without success except when changing transport to tcp but that will make the transmission slower since our app is very latency intensive
@Moe03 my dockerfile
FROM node:18-bookworm-slim as base
RUN apt-get update && \
apt-get install -y python3 build-essential && \
rm -rf /var/lib/apt/lists/*
ENV MEMORY=4096
WORKDIR /workspace
COPY "./" "./"
RUN npm install
CMD node --max-old-space-size=${MEMORY} index.js
build it with
docker buildx build --platform linux/x86_64 -t whatever:v1 -f Dockerfile .
Hi Guys,
I am creating a docker image for a project that I am working on, and the docker file gets built correctly. However, when it goes to run, it spits out an error saying that it can't find the binary. Something is not working correctly
Dockerfile:
Output when run:
Any help would be much appreciated. I would also like to note that I have it working outside of Docker.