nodetube: OBS - Failed to connect to server when running in docker

Hello,

I’ve been trying for a couple of hours to set up nodetube on my local machine (just to test it out) via docker-compose. I’ve added an extra port for the nodetube container “1935:1935” because I care more about the live streaming aspect of this project, Unfortunately, I couldn’t connect to the live-stream via OBS. Every time I try to start the stream I get the message “Failed to connect to server”.

I went to settings and made sure that I have the right link:

Server:  rtmp://127.0.0.1:1935/live
Stream Key:  /test?key=<my key>

I’ve also looked in the OBS logs and saw this:

14:33:55.946: ------------------------------------------------
14:33:58.007: [rtmp stream: 'simple_stream'] Connecting to RTMP URL rtmp://127.0.0.1:1935/live...
14:33:58.008: [rtmp stream: 'simple_stream'] Interface: Software Loopback Interface 1 (type 24, 1073 mbps)
14:33:58.013: RTMPSockBuf_Fill, remote host closed connection
14:33:58.013: RTMP_Connect1, handshake failed.
14:33:58.013: [rtmp stream: 'simple_stream'] Connection to rtmp://127.0.0.1:1935/live failed: -2
14:33:58.022: ==== Streaming Stop ================================================

I couldn’t see anything in the nodetube container logs (nothing showed up other than the “normal” logs, no errors or warnings).

Could you point out what I’m doing wrong? Thank you very much!

Details about my system: Windows 10 Pro Server: Docker Engine - Community Engine: Version: 20.10.2

About this issue

Most upvoted comments

I plan on it, its a little more complicated then adding a ngnix-rtmp docker container because nodetube expects the stream to be a readable file being created in uploads… Ill see what i can do to remedy that design.

EDIT: very incorrect. the content from HLS is forwarded to the nodetube service directly and authenticated there. recordings is its own directory and separate from uploads entirely.

You would need to run it once to have it copy them to the local directory for you. a word of caution, i would advise against changing the env.sample files and instead simply copy and paste them into the root directory and remove the “.sample” at the end.

That way you have a clean reffernce in the event something breaks due to a setting change. Also, env.sample files are subject to change (and get overwritten) as they are template files observed by git. .gitignore only ignores non sample files with the expectation api keys or private settings are in there…

Glad to hear this issue is resolved though, thanks for confirming.

maaaaaaaaan this is annoying, i had this working the other day, now it wont display anything… Okay, leave it with me i need to figure out why its not publishing anything…

Ok, so first, I’m sorry for the late reply, I’ve been really busy these days. I’ve finally managed to clone your repository and try it out on my machine (Windows). The problem with “failed to connect to server” is gone, it says that it’s connected and also streaming, BUT it’s not streaming… I’ve waited for longer than 10 seconds and still nothing, then I looked into the logs of the nodetube container and saw some 404 errors there whenever I’ve tried to connect to the stream. I don’t know what the problem is this time (or if it’s on my machine). To be sure I’ve also pulled up the good ol’ WireShark and did a scan of the 1935 TCP port. You can download the PCAP file here if you want to check it out too.

Steps to reproduce:

  1. docker-compose up -d
  2. I’ve made an account “test” with the password set to “test”
  3. Started live streaming with OBS

Logs from nodetube container:

> nodetube@1.0.0 start /app
> node --max-old-space-size=4096 app.js
BOOTING APP...
PLUS ENABLED: false
NODE_ENV: development
RUNNING WITH THIS MANY PROCESSES: 1
SAVE AND SERVE FILES DIRECTORY: ./uploads
THE MOST CONTROVERSIAL UPLOAD RATING ALLOWED ON THIS INSTANCE IS: SFW
CACHING IS ON
CACHING IS RUNNING AGAINST: mongodb://nodetube-mongo:27017/nodetube
CONNECTING TO REDIS, HOST: redis, PORT: 6379
CACHE RECENT INTERVAL IN MINUTES: 1
CACHE POPULAR, DAILY STATS AND INDEXES INTERVAL IN MINUTES: 5
(node:18) DeprecationWarning: The option `reconnectTries` is incompatible with the unified topology, please read more by visiting http://bit.ly/2D8WfT6
API key does not start with "SG.".
CONNECTING TO REDIS, HOST: redis, PORT: 6379
ffmpeg path: /app/node_modules/@ffmpeg-installer/linux-x64/ffmpeg
youtube-dl binary path: /app/node_modules/youtube-dl/bin/youtube-dl
DATABASE: mongodb://nodetube-mongo:27017/nodetube
CONNECTING TO REDIS, HOST: redis, PORT: 6379
UPLOADS ON: true
UPLOAD SERVER: /uploads
DOMAIN NAME AND TLD: https://nodetube.live
FRONTEND SERVER:
CACHING LOGS WILL NOT COME THROUGH
CONNECTED TO DATABASE AT: mongodb://nodetube-mongo:27017/nodetube
RUNNING AS FRONTEND
(node:25) DeprecationWarning: The option `reconnectTries` is incompatible with the unified topology, please read more by visiting http://bit.ly/2D8WfT6
NodeTube can be accessed on your local network at 172.18.0.5:3000
Websockets server started over http on port 8443
✓ App is running at http://localhost:3000 in development mode
Press CTRL-C to stop
Access NodeTube on the public web via https://54f375c220a3.ngrok.io. This link will be changed if you restart the app, to
use Ngrok with a permanent subdomain please purchase a token and update the settings in .env.private (see runNgrok function in app.js)
ip: ::ffff:172.18.0.1 req url: http://localhost:49161/ header: undefined
GET / 200 1166.902 ms - -
ip: ::ffff:172.18.0.1 req url: http://localhost:49161/login header: http://localhost:49161/
GET /login 200 529.979 ms - -
ip: ::ffff:172.18.0.1 req url: http://localhost:49161/signup header: http://localhost:49161/login
GET /signup 200 382.480 ms - -
ip: ::ffff:172.18.0.1 req url: http://localhost:49161/signup header: http://localhost:49161/signup
test <--- inputted channelUrl forundefined
(node:25) DeprecationWarning: req.validationErrors() may be removed in a future version. Use req.getValidationResult() instead.
(node:25) DeprecationWarning: collection.count is deprecated, and will be removed in a future version. Use Collection.countDocuments or Collection.estimatedDocumentCount instead
null
POST /signup 302 308.320 ms - 60
ip: ::ffff:172.18.0.1 req url: http://localhost:49161/account header: http://localhost:49161/signup
GET /account 200 463.176 ms - -
ip: ::ffff:172.18.0.1 req url: http://localhost:49161/account/profile header: http://localhost:49161/account
UPDATING PROFILE FOR test
FILE EXTENSION:
{ privs:
{ autoVisibleUpload: false,
mirrorFunctionality: false,
unlistedUpload: true,
privateUpload: true,
youtubeBackup: false,
uploadSize: 2000,
safeForWorkUpload: true,
livestreaming: true,
importer: true },
userSettings: { mirrorOn: false, backupOn: false, monetizationOn: false },
userData: { ips: [] },
socialMedia: {},
emailConfirmed: false,
role: 'admin',
verified: false,
usedUploadServers: [],
receivedSubscriptions: [],
subscriptions: [],
tokens: [],
uploads: [],
comments: [],
filter: 'allAges',
plan: 'plus',
unseenSubscriptionUploads: 0,
curated: false,
credit: 0,
receivedCredit: 0,
defaultQuality: 'low',
blockedUsers: [],
pushNotificationEndpoints: [],
_id: 601af55a262c9c0019d2a37f,
email: '0.77345471427249280.6343746016769172',
password:
'$2a$10$ybUJrmM.CvuWWuqPSh1Upumzrk81kUTwKLwobKnlIgG0jXgWD0Q4.',
channelUrl: 'test',
createdAt: 2021-02-03T19:11:22.291Z,
updatedAt: 2021-02-03T19:11:22.615Z,
__v: 0,
uploadToken: 'Cp0Pk88bbvAnVSqSeKQJExr3Z',
channelName: 'test',
channelDescription: 'test' }
POST /account/profile 200 39.072 ms - 7
ip: ::ffff:172.18.0.1 req url: http://localhost:49161/account?update=success header: http://localhost:49161/account
GET /account?update=success 200 482.061 ms - -
ip: ::ffff:172.18.0.1 req url: http://localhost:49161/account/livestreaming header: http://localhost:49161/account?update=success
::ffff:172.18.0.1 49166 ::ffff:172.18.0.5 3000
::ffff:172.18.0.1
3000
/account/livestreaming
rtmp://172.18.0.5:1935/live/test?key=Cp0Pk88bbvAnVSqSeKQJExr3Z http://localhost:49161/live/test
GET /account/livestreaming 200 318.931 ms - -
ip: ::ffff:172.18.0.3 req url: http://nodetube/livestream/on-live-auth header: undefined
{ app: 'live',
flashver: 'FMLE/3.0 (compatible; FMSc/1.0)',
swfurl: 'rtmp://127.0.0.1:1935/live',
tcurl: 'rtmp://127.0.0.1:1935/live',
pageurl: '',
addr: '172.18.0.1',
clientid: '1',
call: 'publish',
name: '/test',
type: 'live',
key: 'Cp0Pk88bbvAnVSqSeKQJExr3Z' }
Cp0Pk88bbvAnVSqSeKQJExr3Z
authentication passed
found user: test
Access the livestream at /live/test
POST /livestream/on-live-auth 200 23.721 ms - 7
ip: ::ffff:172.18.0.1 req url: http://localhost:49161/live/test header: http://localhost:49161/account/livestreaming
test
GET /live/test 200 4270.033 ms - -
ip: ::ffff:172.18.0.1 req url: http://localhost:49161/test.m3u8 header: http://localhost:49161/live/test
GET /test.m3u8 404 3913.102 ms - -
ip: ::ffff:172.18.0.1 req url: http://localhost:49161/live/test header: http://localhost:49161/account/livestreaming
test
GET /live/test 200 965.145 ms - -
ip: ::ffff:172.18.0.1 req url: http://localhost:49161/test.m3u8 header: http://localhost:49161/live/test
GET /test.m3u8 404 967.588 ms - -
ip: ::ffff:172.18.0.1 req url: http://localhost:49161/live/test header: http://localhost:49161/account/livestreaming
test
GET /live/test 200 930.659 ms - -
ip: ::ffff:172.18.0.1 req url: http://localhost:49161/test.m3u8 header: http://localhost:49161/live/test
GET /test.m3u8 404 1600.369 ms - -
ip: ::ffff:172.18.0.3 req url: http://nodetube/livestream/on-live-done header: undefined
{ app: 'live',
flashver: 'FMLE/3.0 (compatible; FMSc/1.0)',
swfurl: 'rtmp://127.0.0.1:1935/live',
tcurl: 'rtmp://127.0.0.1:1935/live',
pageurl: '',
addr: '172.18.0.1',
clientid: '1',
call: 'publish_done',
name: '/test',
key: 'Cp0Pk88bbvAnVSqSeKQJExr3Z' }
POST /livestream/on-live-done 200 47.194 ms - 4
ip: ::ffff:172.18.0.3 req url: http://nodetube/livestream/on-live-auth header: undefined
{ app: 'live',
flashver: 'FMLE/3.0 (compatible; FMSc/1.0)',
swfurl: 'rtmp://127.0.0.1:1935/live',
tcurl: 'rtmp://127.0.0.1:1935/live',
pageurl: '',
addr: '172.18.0.1',
clientid: '4',
call: 'publish',
name: '/test',


type: 'live',
key: 'Cp0Pk88bbvAnVSqSeKQJExr3Z' }
Cp0Pk88bbvAnVSqSeKQJExr3Z
authentication passed
found user: test
Access the livestream at /live/test
POST /livestream/on-live-auth 200 28.411 ms - 7
ip: ::ffff:172.18.0.1 req url: http://localhost:49161/live/test header: http://localhost:49161/account/livestreaming
test
GET /live/test 200 1984.284 ms - -
ip: ::ffff:172.18.0.1 req url: http://localhost:49161/test.m3u8 header: http://localhost:49161/live/test
GET /test.m3u8 404 2837.900 ms - -
ip: ::ffff:172.18.0.3 req url: http://nodetube/livestream/on-live-done header: undefined
{ app: 'live',
flashver: 'FMLE/3.0 (compatible; FMSc/1.0)',
swfurl: 'rtmp://127.0.0.1:1935/live',
tcurl: 'rtmp://127.0.0.1:1935/live',
pageurl: '',
addr: '172.18.0.1',
clientid: '4',
call: 'publish_done',
name: '/test',
key: 'Cp0Pk88bbvAnVSqSeKQJExr3Z' }
POST /livestream/on-live-done 200 14.907 ms - 4
ip: ::ffff:172.18.0.1 req url: http://localhost:49161/ header: undefined
GET / 200 652.027 ms - -