ondemand icon indicating copy to clipboard operation
ondemand copied to clipboard

[BUG] 3.1.9 Download not working on text file

Open vtpo2021 opened this issue 1 year ago • 7 comments

I have 3.1.9 installed and I had a user report that any files that has text would not download when clicking the 3 dot and then download. Anything with binary would download without any problem.

I managed to get around this by clicking the 3 dot, hover over the "Download", right click, and clicking "Save link as..." to download it. I don't know if it matters but we are using beegfs for our storage.

vtpo2021 avatar Oct 16 '24 23:10 vtpo2021

Odd. I can't seem to replicate. What OS and browser are you on? Is there anything in /var/log/ondemand-nginx/$USER/error.log that would indicate why it's not working?

Or when you click download is there anything in your browsers console that may indicate the error?

johrstrom avatar Oct 17 '24 13:10 johrstrom

I'm on Windows 10. I tested with Firefox, Chrome, and Edge and all does the same. No errors in log.

I can see in the console that the file size is correct when I click on download, but I never get prompted on the browser to download or download and save the file. Checking the download history also shows nothing. Both screenshots are from Firefox console. image

In the console, if I click on the file I'm trying to download, the response shows the content of the file. image

vtpo2021 avatar Oct 17 '24 16:10 vtpo2021

I can see in the console that the file size is correct when I click on download, but I never get prompted on the browser to download or download and save the file.

I don't get prompted either - I think that's a setting on your browser. For me, it just downloads into my Downloads folder without a prompt.

This worked in 3.1.7? We didn't really change anything with downloads. The updates in 3.1.9 around downloads were really just visual (when to show the button and when not to), shouldn't have affected the actual downloads.

What's more is downloads still very much work for me in 3.1.9, so I'm a bit at a loss here.

johrstrom avatar Oct 17 '24 18:10 johrstrom

I reverted my VM to 3.0.3 and the download works fine on it. I get a prompt to save the file as well. I jumped from 3.0.3 to 3.1.9 so I don't have 3.1.7 to test. I'll do the upgrade from 3.0.3 to 3.1.7 and test again.

vtpo2021 avatar Oct 18 '24 17:10 vtpo2021

Oh OK you went from 3.0 to 3.1. I'd just assumed the 3.1.7. No I don't think there's any need to go to that version. It seems to be something in the 3.1 series that's throwing you off. I'll look more into it the 3.0 behaviour and maybe change my browser setttings to prompt me.

johrstrom avatar Oct 18 '24 18:10 johrstrom

OK - this is the same issue as #3895 - or at least the same root cause. Are you able to update your httpd/apache2 version?

johrstrom avatar Oct 23 '24 15:10 johrstrom

In any case, for 3.1.9 it seems we need an update to httpd. Seems like you can either run 3.1.7 with your current version of httpd or update httpd and use 3.1.9.

johrstrom avatar Oct 23 '24 15:10 johrstrom

Sorry I meant this is the same issue as #3894. You'll need to update your httpd version.

johrstrom avatar Oct 30 '24 14:10 johrstrom

I will try 3.1.7. I'm on Rocky 8 so I don't think I can get a newer httpd version.

vtpo2021 avatar Nov 04 '24 17:11 vtpo2021

8.8 has the right version. Or even if you notice #3894, I'm able to pull the 8.8 httpd version in an 8.4 container.

johrstrom avatar Nov 04 '24 17:11 johrstrom

I just went from 3.1.1 to 3.1.9 and I have issues with downloads as well.

Attempts to download directories pop up an error. Attempts to download individual files silently fail... but the javascript console looks thusly:

image

Xaraxia avatar Nov 07 '24 02:11 Xaraxia

Jumping in to say we're experiencing the same issue as well. Was on 3.1.9, just upgraded to 3.1.10 and still seeing it.

Viewing the Network tab in Chrome when trying to debug, the file reaches the browser with a 200, but then the console emits the same kt is not a function errror on rails-ujs.esm.js:250, exactly as @Xaraxia's screenshot above.

Is this simply a bad package (rails-ujs)?

Zoidmania avatar Dec 04 '24 16:12 Zoidmania

I don't think it's an issue on the client side (i.e., your browser). I believe the query parameters aren't being passed to the application. I'm pretty sure this is a duplicate of #3894 in that it's the same underlying root cause.

What's your OS, httpd version and md5 checkusm of $(which httpd)?

johrstrom avatar Dec 04 '24 17:12 johrstrom

Image I think there are two problems - when trying to download two files, the files are successfully returned by the server, but download does not trigger.

In the case of trying to download a directory... you get an 'undefined' error turning up on the dashboard. The request returns 200 in apache .... 103.95.114.107 - uqsarahw [21/Feb/2025:15:53:57 +1000] "GET /pun/sys/dashboard/files/fs//scratch/user/uqsarahw/lmdocs?can_download=1740117237730 HTTP/1.1" 200 9050 "https://bunya-ondemand.rcc.uq.edu.au/pun/sys/dashboard/files/fs//scratch/user/uqsarahw" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36 Edg/132.0.0.0"

and in nginx ... unix: - - [21/Feb/2025:15:53:58 +1000] "GET /pun/sys/dashboard/files/fs/scratch/user/uqsarahw/lmdocs HTTP/1.1" 200 9063 "https://bunya-ondemand.rcc.uq.edu.au/pun/sys/dashboard/files/fs//scratch/user/uqsarahw" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36 Edg/132.0.0.0" "103.95.114.107"

So, I'm wondering if something funky is happening with the javascript?

Xaraxia avatar Feb 21 '25 05:02 Xaraxia

Okay, can confirm it was httpd - I got a marginally newer build installed and it's working. I had a previous patch release on that node. That's maddening but at least we have an answer. Thanks for your time.

Xaraxia avatar Feb 21 '25 06:02 Xaraxia

Okay, can confirm it was httpd - I got a marginally newer build installed and it's working. I had a previous patch release on that node. That's maddening but at least we have an answer. Thanks for your time.

I'm so sorry for all the issues with this httpd. This all started when Amazon linux updated to 2.4.62 and broke our test suites, then I reached out to the apache httpd developers and they said The way you enable the proxy in your lua hook is not supported. So it had been working by coincidence I guess for all these years? so I had to update to support higher versions, but that broke older versions and put us in a really tough spot because I can't see how to code to support both.

In any case, I'm terribly sorry for all of this.

https://bz.apache.org/bugzilla/show_bug.cgi?id=69261

johrstrom avatar Feb 21 '25 14:02 johrstrom

Hey all, again so sorry for the issues that httpd has been causing us. We believe that this will only get better over time as RHEL distributes updates to the httpd package.

Again, sorry for the issues. I'm going to close this now as solved as we believe an update to httpd should resolve all these issues and that every version of RHEL has distributed the updates to httpd.

johrstrom avatar Sep 18 '25 18:09 johrstrom