-
Notifications
You must be signed in to change notification settings - Fork 31
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
GnuTLS Error When Fetching > 5 Opencast (4.x) Events #609
Comments
Hi @spoonsauce, which version of Opencast are you testing this against? |
Hi @Alfro, Apologies, I forgot a few key details. We're scrambling to try and get this resolved as quickly as possible! A bit about our Opencast setup: We're running Opencast 4.5, but were previously running 4.4 with the same problem. Opencast has an NGINX reverse proxy in front of it for SSL. https://opencast.example.com (NGINX) -> 127.0.0.1:8080 (Opencast) Our Galicaster machines are a clean install of Ubuntu 16.04 with Blackmagic software and Galicaster. There are a few different iterations with slightly varying configs, but nothing major changes from one to the other. |
@spoonsauce All Galicaster is doing is calling curl and passing along the curl error, which seems to suggest a config error possibly with nginx? does using curl directly work? make sure to try it from the galicaster machine. this is the equivalent curl command line for the settings used by galicaster: obviously you'll need to substitute the user/pass, opencast address and agentid. (@Alfro as an aside, disabling SSL cert checks seems like a bad idea?!) |
@ppettit Thanks for the suggestion. It looks like a direct curl command works. Here are the results (with a ton of information obfuscated):
Events repeat several times...
I've decoded a few of the BASE64 values and they are valid. If any particular bit of obfuscated information is required, please let me know. |
@spoonsauce very strange. assuming that was done when the galicaster would have failed (>5 recordings scheduled) can you repeat when it would have succeeded (<5 recordings scheduled) and see if anything is different? you do get the "closing connection" and "TLS alert" response which I don't with any server i've tried with (all my traces end with i'm not sure why the result would be different using the curl command directly rather than through pycurl. can't think of anything else obvious to try at the moment 😞 |
@ppettit Interesting results, but I'm not sure what to do with them. I dumped the output of a curl call with 6 events and with 5 events. Other than the obvious changes, the TLS alert disappears at the end of the call with 5 events. 5 events:
6 events:
I'm not a TLS expert either, but I'll look into this. Nevertheless, would this prevent Galicaster from fetching the events list? The data itself is usable in both cases. |
I realized I was testing on a machine with curl compiled with OpenSSL. With GnuTLS I get the exact message Galicaster reports:
However, all the data is there and usable. There may definitely be something wrong with our NGINX setup, but I think Galicaster is assuming there is a problem with the above message is returned, when in fact it may be better to treat that as a warning than an show-stopper error? |
(sorry i had not seen your message above when i wrote this!) i guess one thing we could (probably should at some point anyway) do would be to allow you to config the calendar cutoff and then you could send it to a fairly small value so you would only ever get less than 5 scheduled events returned (unfortunately you have to specify a timestamp as the cutoff so you can't just ask for the next 4 recordings). it is not really solving this problem though. |
Could be related to chunked data being returned in the response? The error
in your previous email is mentioned here in relation to that:
curl/curl#3148
…On Tue, 8 Jan 2019 at 17:39, spoonsauce ***@***.***> wrote:
I realized I was testing on a machine with curl compiled with OpenSSL.
With GnuTLS I get the exact message Galicaster reports:
* GnuTLS recv error (-110): The TLS connection was non-properly terminated.
* Closing connection 0
curl: (56) GnuTLS recv error (-110): The TLS connection was non-properly terminated.
However, all the data is there and usable. There may definitely be
something wrong with our NGINX setup, but I think Galicaster is assuming
there is a problem with the above message is returned, when in fact it may
be better to treat that as a warning than an show-stopper error?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#609 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACm-FwkKLjKowDAKFaQuiZXI-_63jcErks5vBNfHgaJpZM4Z0Fg2>
.
|
@pmgration yeah that could be the case especially as it only happens with longer responses! @spoonsauce ah, that makes more sense! could still be an nginx config problem i guess, or a bug in curl/gnutls (or both). I suppose it really depends where the error is thrown, if it gets far enough to be able to grab the data that has already been sent - hard to test without being able to reproduce the problem though. could you try adding self.logger.warning('Problems to connect to opencast server: {0}'.format(exc), exc_info=1) that should add a stack trace to the galicaster log for that exception which might give some more clues. the other thing would be to try switching to requests instead of pycurl and see if that doesn't have the same issue. that is a fair amount of work though. |
@pmgration Seems very probable. I'm not sure how to what (if anything) to change in NGINX's but it gives me something to go on. @ppettit Here's are the relevant log lines after the change:
Appreciate all the help on this so far! |
sorry for the delay i got a bit busy! yeah that stack trace is pretty unhelpful unfortunately 😞 try replacing make sure you install python-requests not sure if this will help or not but maybe worth a try. it will spew out loads of debug info on the console, and hopefully helpful stack traces in the logs. |
No problem at all. I created a bit of a hacky work-around that limits the cutoff that Galicaster fetches from Opencast to a single day, so I am back up and running. Not ideal, but it works. The
Any issues using this across our deployment as a temporary fix? |
Have you tried using an http rather than https URL for Opencast? That would help establish if the issue is in the TLS/SSL libraries. |
@smarquard it does look like it is a problem with the combination of the nginx config, and curl compiled with gnutls but not openssl. @spoonsauce yay! Glad that worked! As I said I did this quickly and didn't do much testing, so I would definitely test to make sure everything you need is working properly (particularly ingesting which required the most change). You might want to delete the block starting I will tidy it up and make a pull request but that might take me a while. |
@ppettit I've been running several test recordings on a dev box with your modified client.py. So far only one error, I'm not sure if it's a fluke or related to the changes made:
Recording files look fine and are viewable. Manually ingesting produces the same error. Also, for the record, we're using an identical NGINX configuration to the one found here: https://docs.opencast.org/r/5.x/admin/configuration/https/nginx/ I've attempted to disabled chunked transfers but no matter what I try the headers return I will spin up a dev instance and test without HTTPS when I have a bit of time. I'd imagine it will work fine. |
@spoonsauce cool, sounds like it is mostly OK then. So that recording that failed to ingest also fails when you try to re-ingest manually? If so, is there anything obviously different about it? Is it possible to share the repository folder for it (at least the metadata files if the video is too big)? |
@ppettit That's correct. There's nothing unusual about the recording that I can think of. I've also had a second one fail to ingest. I'm happy to send over the files, though the videos may be too large. My preference would be to email them to you, but I can also just add them here and remove them once you've had a chance to download the files. |
@spoonsauce sure email is fine (check my profile) or share on something like google drive if you like another interesting thing to try would be point you galicaster at a public opencast like https://stable.opencast.org and seeing if it ingests manually there |
@ppettit Google Drive link sent to your inbox. Can you share publishing credentials for stable.opencast.org? I tried admin:opencast got a 401. I'd also like to try recompiling python-pycurl with OpenSSL instead of GnuTLS to see what that does with an un-patched client.py. |
@spoonsauce cool I'll take a look tomorrow. The default digest credentials for opencast are: opencast_system_account:CHANGE_ME |
@spoonsauce those recordings ingest ok to my test and production machines, with both gc 2.1.1 and my patched client.py so i can't see anything wrong with them. definitely remove the debug stuff as I mentioned above - that slows things down considerably withig binary files. we use haproxy rather than nginx though. it does still look look like there is something weird with your proxy, but I guess pucurl/OpenSSL and requests are somehow more tolerant than pycurl/GnuTLS. |
@ppetit The strange part is our proxy worked fine for 4 straight months. This GnuTLS nonsense only began when I came back from holiday. The only change was an upgrade to Galicaster 2.1.1, which is why I initially thought that was the issue. I know there were upgrades done to switches and hypervisors over the holidays, so that may or may not have something to do with it. On the bright side, the recompiled python-pycurl + OpenSSL libraries fetches schedules correctly. I'm testing ingestion as I write this. Fingers crossed! Edit: Confirmed that ingesting works with the recompiled python-pycurl libraries. |
Galicaster 2.1.1 throws the following exception when trying to fetch more than 5 events in a single location :
This appears to be related to the
process_ical()
functions, but my Python chops aren't up to snuff to really troubleshoot this.I can reproduce this across all of my 2.1.1 machines.
2.1.0 works, but that version is no longer available on the Xenial repository as far as I can tell? As soon as I remove events >= 6, Galicaster once again successfully fetches events.I will try to find another way to roll-back in the meantime.Correction: Even after rolling back I have the same problem, so this may be related to another Ubuntu package which was upgraded. Any ideas?
The text was updated successfully, but these errors were encountered: