Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"OSError: [Errno 41] Protocol wrong type for socket" on OS X #248

Open
splitsurround opened this issue Apr 8, 2021 · 13 comments
Open

"OSError: [Errno 41] Protocol wrong type for socket" on OS X #248

splitsurround opened this issue Apr 8, 2021 · 13 comments

Comments

@splitsurround
Copy link

Hi. I got locast2plex installed and working. I can fire up a show, all seems good. But after a few minutes, every time, this error reports in my terminal app:

OSError: [Errno 41] Protocol wrong type for socket

Since I'm not very knowledgable about command line stuff or python, I asked a python group to take a look and immediately was told it's a bug in the software. I can't say that it is for sure, but something odd is bumping me off my connection.

thanks!

@osxster
Copy link

osxster commented Apr 15, 2021

I get the same thing, but it might be once a day. It works perfect otherwise, but I get this error, it hangs, I need to Ctrl C it, then launch it again. This is also OS X, running on a BigSur server.


Exception occurred during processing of request from ('', 51835)
Traceback (most recent call last):
File "/usr/local/Cellar/python@3.9/3.9.2_4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/socketserver.py", line 316, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/local/Cellar/python@3.9/3.9.2_4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/socketserver.py", line 347, in process_request
self.finish_request(request, client_address)
File "/usr/local/Cellar/python@3.9/3.9.2_4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/socketserver.py", line 360, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/local/Cellar/python@3.9/3.9.2_4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/socketserver.py", line 720, in init
self.handle()
File "/usr/local/Cellar/python@3.9/3.9.2_4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/server.py", line 427, in handle
self.handle_one_request()
File "/usr/local/Cellar/python@3.9/3.9.2_4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/server.py", line 415, in handle_one_request
method()
File "/Users//Library/Application Support/locast2plex-main/lib/tuner_interface.py", line 109, in do_GET
self.do_tuning(contentPath.replace('/watch/', ''))
File "/Users//Library/Application Support/locast2plex-main/lib/tuner_interface.py", line 358, in do_tuning
self.wfile.write(videoData)
File "/usr/local/Cellar/python@3.9/3.9.2_4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/socketserver.py", line 799, in write
self._sock.sendall(b)
OSError: [Errno 41] Protocol wrong type for socket

Any info would be great!

@splitsurround
Copy link
Author

splitsurround commented Apr 15, 2021 via email

@osxster
Copy link

osxster commented Apr 26, 2021

When you say you went the Docker route, did you install docker on OS X or did you install it on a Linux box? I’m running BigSur in a vm already, so I didn’t want to use Docker which typically would be a vm in a vm.

I was hoping there would be a fix to address this natively rather than having to run this on Linux for example, since this is so close to working perfect.

@splitsurround
Copy link
Author

splitsurround commented Apr 26, 2021 via email

@H3avyC
Copy link

H3avyC commented Aug 6, 2021

Also having this same issue. Seems to occur when I click the X button to end a streaming session on a given channel. Happening about 50% of the time. Restarting the terminal session makes it go back to normal. Not sure where to start troubleshooting it.

@splitsurround
Copy link
Author

splitsurround commented Aug 6, 2021 via email

@H3avyC
Copy link

H3avyC commented Aug 6, 2021

I ran into some issues with HomeBrew on 10.13. Maybe I should give it another try.

update
Yeah, locast2tuner isn’t an option. Homebrew fails to install on this OS. It’s an older machine, and I can’t go past 10.13.

@jeffmeacham99
Copy link

jeffmeacham99 commented Aug 16, 2021

I get the same thing, but it might be once a day. It works perfect otherwise, but I get this error, it hangs, I need to Ctrl C it, then launch it again. This is also OS X, running on a BigSur server.

Exception occurred during processing of request from ('', 51835)

Traceback (most recent call last):
File "/usr/local/Cellar/python@3.9/3.9.2_4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/socketserver.py", line 316, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/local/Cellar/python@3.9/3.9.2_4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/socketserver.py", line 347, in process_request
self.finish_request(request, client_address)
File "/usr/local/Cellar/python@3.9/3.9.2_4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/socketserver.py", line 360, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/local/Cellar/python@3.9/3.9.2_4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/socketserver.py", line 720, in init
self.handle()
File "/usr/local/Cellar/python@3.9/3.9.2_4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/server.py", line 427, in handle
self.handle_one_request()
File "/usr/local/Cellar/python@3.9/3.9.2_4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/server.py", line 415, in handle_one_request
method()
File "/Users//Library/Application Support/locast2plex-main/lib/tuner_interface.py", line 109, in do_GET
self.do_tuning(contentPath.replace('/watch/', ''))
File "/Users//Library/Application Support/locast2plex-main/lib/tuner_interface.py", line 358, in do_tuning
self.wfile.write(videoData)
File "/usr/local/Cellar/python@3.9/3.9.2_4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/socketserver.py", line 799, in write
self._sock.sendall(b)
OSError: [Errno 41] Protocol wrong type for socket
Any info would be great!

I am having the exact issue. I had a few hurdles during installation, but have it up and running under these conditions:

MacOS 10.14.6 (Mojave)
Terminal
Python 3.9
Plex Server ver. 1.24.0.4930
FFmpeg installed via Brew

I couldn't get a live stream to work on any Plex client type however could DVR and watch after the show ended (strange), but resolved by adding tuner_type=Cable to the .ini file. Now I'm having the issue describe above. I am having to use one of the three tuners locally (not ideal) on the server to keep it up and running so that I can access from other clients. As soon as I end ANY tuner stream from ANY Plex client type it kills the Locast2Plex script in Terminal. Here are my logs for reference upon ending a live stream within Plex Client:


Exception occurred during processing of request from ('192.168.4.31', 62194)
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/socketserver.py", line 316, in _handle_request_noblock
self.process_request(request, client_address)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/socketserver.py", line 347, in process_request
self.finish_request(request, client_address)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/socketserver.py", line 360, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/socketserver.py", line 747, in init
self.handle()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/server.py", line 427, in handle
self.handle_one_request()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/server.py", line 415, in handle_one_request
method()
File "/Users/jeffmeacham/Downloads/locast2plex-main/lib/tuner_interface.py", line 109, in do_GET
self.do_tuning(contentPath.replace('/watch/', ''))
File "/Users/jeffmeacham/Downloads/locast2plex-main/lib/tuner_interface.py", line 358, in do_tuning
self.wfile.write(videoData)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/socketserver.py", line 826, in write
self._sock.sendall(b)
OSError: [Errno 41] Protocol wrong type for socket

Thanks for any insights out there to resolve.

@splitsurround
Copy link
Author

splitsurround commented Aug 16, 2021 via email

@jeffmeacham99
Copy link

I recommend changing to locast2tuner. It’s way more stable and has been working well for me for ha without issues.

Done! You're right, appears to be much more stable. Also additional features are great. Thanks for the heads up. Cheers!

@osxster
Copy link

osxster commented Aug 16, 2021

Hello,

I had resolved this issue by running it within Docker. I have no idea why it works better within Docker. I'd prefer to run it without Docker as I am running this OSX instance as a VM anyway, so it is a little slower running in Docker, but I have found it to be very stable within Docker and rarely crashes. Any way we can fix this so that we do not need to use Docker?

@splitsurround
Copy link
Author

splitsurround commented Aug 16, 2021 via email

@H3avyC
Copy link

H3avyC commented Aug 19, 2021

I also ended up just getting Docker up and running. So far so good. If I run into issues, I’ll take a look at locast2tuner, but for right now, it’s working just fine. I’m able to start and stop streams without encountering any errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants