Moodle file picker not working

Moodle file picker not working

deur Taj Des -
Getal antwoorde: 45

Hello all,

I have a new moodle site hosted in blue host (shared hosting). Initially I was able to add files (pictures, pdf) to the front page and to courses. Some weeks later though, I couldn't. When I click the 'Add an activity or resource' link and select a file to upload, for example, the file picker keeps loading infinitely as shown in the figure below.

I have searched several forum posts for a solution but not successful so far. The host says 'this is a moodle issue'. I am stuck here. Your help is most appreciated


Regards,

Aanhangsel filepicker.JPG
Gemiddeld van beoordelings: -
In antwoord op Taj Des

Re: Moodle file picker not working

deur Taj Des -

If someone has come across with such an issue (posted above) or if you think you have a solution for it, then please help me. I'm still waiting for some enlightenment...


Thanks,

Gemiddeld van beoordelings: -
In antwoord op Taj Des

Re: Moodle file picker not working

deur Emma Richardson -
Prentjie van Documentation writers Prentjie van Particularly helpful Moodlers Prentjie van Plugin developers

Try clearing your caches...

Gemiddeld van beoordelings: -
In antwoord op Emma Richardson

Re: Moodle file picker not working

deur Rob Clark -

Hi,

I'm experiencing the same problem.  File picker in the forums are not loading correctly into the page, but it is not consistent.  The problem does not happen on some browsers, but is happening on other browsers and operating systems.  It is also not consistent across the entire Moodle site.  The file picker loads properly in assignment submission, but not on forum postings.

I'm running Moodle 2.7.

  • Firefox 53.0 for Mac - loads properly
  • Safari 10.0.2 for Mac - does not load the picker
  • Chrome 57.0.298 for Mac - does not load the picker
  • Firefox 52.0.2 for Windows - loads properly
  • Firefox 53 for Windows - does not load the picker
  • Chrome 58.0.3 for Windows - does not load the picker
  • Internet Explorer 10 for Windows - does not load the picker
  • Microsoft Edge for Windows - does not load the picker

I have tried clearing cache, doing a hard refresh, using different browsers and operating systems, etc. to identify the source of the problem, but to no avail.  I have several hundred students in courses right now who are not able to submit files because of this problem.

Any help anyone can provide would be greatly appreciated.

Thanks.

Gemiddeld van beoordelings: -
In antwoord op Rob Clark

Re: Moodle file picker not working

deur Emma Richardson -
Prentjie van Documentation writers Prentjie van Particularly helpful Moodlers Prentjie van Plugin developers

Try turning off the Javascript caching found under Appearance/Javascript and Ajax - I had to do that on one of my sites.

Gemiddeld van beoordelings: -
In antwoord op Emma Richardson

Re: Moodle file picker not working

deur Rob Clark -

Hi Emma,

Thanks for your prompt response.  I just tried your suggestion with hard resets and cleared caches all around, but it didn't work.  Anything else come to mind?

It only just started happening yesterday, and one of my staff just had her browser update when she re-opened it and the problem started for her with the new update.  The only thing that I can see as a common major update across all browsers is that they have all stopped supporting Java NPAPI with the latest release.  Do you know if the Moodle File Picker is run as NPAPI?  I can't find anything in the documentation.

Cheers,

Rob





Gemiddeld van beoordelings: -
In antwoord op Rob Clark

Re: Moodle file picker not working

deur Rob Clark -

Is it because the File Picker in Moodle 2.7 runs as NPAPI, which is no longer supported by browsers?

R

Gemiddeld van beoordelings: -
In antwoord op Rob Clark

Re: Moodle file picker not working

deur Rob Clark -

Found the problem.  The mathjax shutdown on April 30th was the source.  I simply loaded mathjax on my local server and redirected it in Site Administration > Plugins > Filters > MathJax from cdn.mathjax.org to mymoodleserver.com. 

Problem solved.  Thanks a lot for your help, Emma.

Rob

Gemiddeld van beoordelings: -
In antwoord op Rob Clark

Re: Moodle file picker not working

deur Ron Vitug -

We have same issue file picker is just keep spinning/loading. Then it will hang the moodle site I need to restart apache to able to access again. Moodle 3.1.6 is our versionscreenshot


Aanhangsel moodle file picker.JPG
Gemiddeld van beoordelings: -
In antwoord op Ron Vitug

Re: Moodle file picker not working

deur Ken Task -
Prentjie van Particularly helpful Moodlers

Did you recently upgrade from 3.0.highest to 3.1.highest?

Actually, that might not matter but would help me verify what I found doing an upgrade as above.

Beginning version 2.9.x Moodle 'transitioning' away from the YUI library.  YUI library might be used in filepicker.

https://docs.moodle.org/dev/YUI

Is your site set to combo load YUI libraries?

Try this in config.php of site:

$CFG->useexternalyui='0';
$CFG->yuicomboloading='0';

Check your DB - mdl_config table to see any settings for YUI external or combo loading.

Purge server caches ... might have to do that manually to assure
caches have been eradicated.

IF the above works, suggest making sure that YUI settings stay '0'
by editing the mdl_config table and setting the above variables to '0'.

You could then remove the config lines.

'spirit of sharing', Ken


Gemiddeld van beoordelings:Useful (1)
In antwoord op Ken Task

Re: Moodle file picker not working

deur Ron Vitug -

Tried and still no luck. I am thinking if it's a repository matter since we upgrade it to the new server?


We're running PHP on Apache with mod_php 

Gemiddeld van beoordelings: -
In antwoord op Ron Vitug

Re: Moodle file picker not working

deur Ken Task -
Prentjie van Particularly helpful Moodlers

Describe 'upgrade it to the new server', please.

What makes one think it's a repository matter?

"Faculty Documents" looks to be a file system repo.

So in moodledata/repository/ ... what does 'Faculty Documents' label actually point to?

And does what it points to has correct ownership/permissions?

If version 3.3 you have a new CLI script in moodlecode/admin/cli/

Run from moodlecode/admin/cli/

what does the following show?

php cfg.php |grep repository

and

php cfg.php |grep yui

'spirit of sharing', Ken


Gemiddeld van beoordelings: -
In antwoord op Ken Task

Re: Moodle file picker not working

deur John Joubert -

Ken,


I'm running moodle 3.1.3 - and YUI combo loading is turned off. However, it's default is to be on.   I'm dealing with performance issues since my recent upgrade from moodle 2.7 to 3.1.3.  Is this safe/good to turn on?  Or, should I be avoiding this since, like you, I've read that it's going to be depracated at some point...


Any advice, direction, pointers, etc. appreciated very much.


John

Gemiddeld van beoordelings: -
In antwoord op John Joubert

Re: Moodle file picker not working

deur Ken Task -
Prentjie van Particularly helpful Moodlers

Not sure that YUI alone would be the single factor in a hyperjump between long term support versions 2.7.x to 3.1.x in performance issues.   Like all previous versions of Moodle every version upwards does more ... and seems to require more resources of server.

Did you do the environment check and update that component before upgrading?  Did you have to 'fix' anything while at 2.7?  Run it again, now at 3.1.x and see if there are not some recommendations.

As far as performance issues ... think you'll have to share a complete description of your system(s).

'spirit of sharing', Ken




Gemiddeld van beoordelings: -
In antwoord op Ken Task

Re: Moodle file picker not working

deur Matt Donnelly -

Thanks Ken! 

File Picker was consistently hanging only in Chrome for 30sec (checked Network Tab in Inspector) on Moodle 3.5 before allowing me to select files.

Adding those two lines to config.php fixed the problem immediately. 

Gemiddeld van beoordelings: -
In antwoord op Matt Donnelly

Re: Moodle file picker not working

deur John Byrne -

What were the lines?  It sounds like that was the problem.

I'm having the same issue.  Please help.

Thank you,

John Byrne

Gemiddeld van beoordelings: -
In antwoord op John Byrne

Ri: Re: Moodle file picker not working

deur MARCO BONFIENI -
Hello there,
if I can share my experience, took a lot of time also for me to figure it out!
I also know it has been 6 months since that post: the problem was in my case the SSL certbot from Let's Encrypt

You can find the solution also in another locked post, it really did the trick!

Fin your ssl.conf file, usually located under /etc/httpd/conf.d

Find the line
Header always set X-Frame-Options

Should be set "DENY" by default... replace "DENY" with "SAMEORIGIN", then restart your httpd service.

Boom!
Gemiddeld van beoordelings: -
In antwoord op MARCO BONFIENI

Re: Ri: Re: Moodle file picker not working

deur Landy DeField -

This worked for me! 

Hey documentation @Moderator this really should be added to https://docs.moodle.org/311/en/Transitioning_to_HTTPS page.

Gemiddeld van beoordelings: -
In antwoord op Landy DeField

Re: Ri: Re: Moodle file picker not working

deur Andrew Lyons -
Prentjie van Core developers Prentjie van Moodle HQ Prentjie van Particularly helpful Moodlers Prentjie van Peer reviewers Prentjie van Plugin developers Prentjie van Testers
Hi Landy,

Thankfully that page is a wiki and can be amended using your moodle.org login credentials. You would be in a good plac eto update this documentation as you have experienced this issue and understand the changes.

I'm not quite sure why this is ncessary - I don't believe that it should be for normal usage, and this is very much a configuration issue - it will depend on your Apache installation and configuration and you should understand such changes before making them.
Gemiddeld van beoordelings: -
In antwoord op Andrew Lyons

Re: Ri: Re: Moodle file picker not working

deur Landy DeField -

I did not see the edit link for that page, I will look harder. ;)

Reasons it should be included on the page.

  1. It is 100% related to transitioning from HTTP - HTTPS.
  2. If you transition from HTTP - HTTPS and do not edit the Apache config file, the popup ajaxified file dialog window just sits and spins... glimlag
  3. It is not easy to diagnose as no error generated in apache2 error log.
  4. Save people making the move to HTTPS on Apache some time and stress. :D 
Gemiddeld van beoordelings: -
In antwoord op Landy DeField

Re: Ri: Re: Moodle file picker not working

deur Andrew Lyons -
Prentjie van Core developers Prentjie van Moodle HQ Prentjie van Particularly helpful Moodlers Prentjie van Peer reviewers Prentjie van Plugin developers Prentjie van Testers
It is 100% related to Apache configuration. You are including a default configuration for SSL from your linux distribution which includes the DENY line. Not all stock configurations will include this line, or with this default setting.

Your previous configuration did not include this line, but it could easily have done so - it is an http response header and can exist on both HTTP and HTTPS connections.

You should ensure that you understand the purpose of this lin before making these changes.
Gemiddeld van beoordelings: -
In antwoord op Andrew Lyons

Re: Ri: Re: Moodle file picker not working

deur Landy DeField -
Not really seeing where your coming from as https://docs.moodle.org/311/en/Transitioning_to_HTTPS has 100% Apache configurations listed, the edits should be done to the .htaccess file which is distribution agnostic, and the link I included goes into depth about the purpose of the Header always set X-Frame-Options as well as WAMP configurations.
When all is said and done, I took the time to submit an edit, as you pointed out I could. Either it's accepted or not, either way I did due diligence.
Peace Out! :D
Gemiddeld van beoordelings: -
In antwoord op Andrew Lyons

Re: Ri: Re: Moodle file picker not working

deur Landy DeField -
I submitted the following edit to the end of the page.

"
=== File upload dialog configuration for Apache2 ===
If you are using Apache2 on a Linux server after transitioning to HTTPS, the file upload dialog may not work properly and hang after clicking the upload button. In order to correct this, you will need to edit the /moodle/.htaccess file.
You will need to add the following:

Header always set X-Frame-Options SAMEORIGIN


Save the file then reload/restart the Apache2 server.

* [https://apache.tutorials24x7.com/blog/how-to-secure-apache-from-clickjack-attack-using-x-frame-options Tutorial Explaining X-FRAME Options With LAMP & WAMP How To]
"
It is now in the hands of the wiki gods ;)
Gemiddeld van beoordelings: -
In antwoord op Ron Vitug

Re: Moodle file picker not working

deur Rodrigo Ribeiro -

Hello


Having the same inssue! My server is a DigitalOcean VPS ans everything is ok with VPS.

Centos7++Apache2+PHP7 (no fpm)+Moodle 3.4+


Alredy tried to set yui to "0" in mdl_config....not solved.


When send any file the circle still running forever...


What i have to do?



Gemiddeld van beoordelings: -
In antwoord op Rob Clark

Re: Moodle file picker not working

deur Daniel Thies -
Prentjie van Core developers Prentjie van Particularly helpful Moodlers Prentjie van Plugin developers Prentjie van Testers

Hi Ron,

Are you running PHP on Apache with mod_php or with php-fpm? I had a similar problem switching from Apache to Nginx.

Daniel

Gemiddeld van beoordelings: -
In antwoord op Daniel Thies

Re: Moodle file picker not working

deur Francisco Nieto -

Did you find a solution to your issue? I have moved to ngixn and php7.0-fpm, and I am experiencing the same issue. When I try to upload a file with the file picker, it keeps spinning and it seems like it never upload the file; however, when I drag and drop the file, I do not have any issue.

Gemiddeld van beoordelings: -
In antwoord op Francisco Nieto

Re: Moodle file picker not working

deur Daniel Thies -
Prentjie van Core developers Prentjie van Particularly helpful Moodlers Prentjie van Plugin developers Prentjie van Testers
Yes, there is a setting that needed to be changed in the http block of my nginx.conf. The parameter client_max_body_size has a default value of 1M. This limits any file upload to the server even though php settings are higher. It is not detectable by the browser so nothing is reported.
Gemiddeld van beoordelings: -
In antwoord op Daniel Thies

Re: Moodle file picker not working

deur Francisco Nieto -

Thanks so much for answering me back, but my issue was not the parameter client_max_body_size, it was the parameter below, I had the parameter set up as "DENY" instead of "SAMEORIGIN"


add_header X-Frame-Options SAMEORIGIN;


Thanks again for you prompt answer.

Francisco

Gemiddeld van beoordelings:Useful (1)
In antwoord op Francisco Nieto

Re: Moodle file picker not working

deur Harry McLaren -

Just an FYI for others, our site had this issue and after MUCH troubleshooting, it was the Cloudflare 'Rocket Loader' which was breaking it. 

Gemiddeld van beoordelings:Useful (2)
In antwoord op Harry McLaren

Re: Moodle file picker not working

deur David Le Blanc -
Thank you for this post Harry. How did you resolve the issue with Cloudflare 'Rocket Loader'? I have started to experience difficulties with the File picker and even uploading images with the dialog box that appears after clicking the images button in our atto editor. 
Gemiddeld van beoordelings: -
In antwoord op Taj Des

Re: Moodle file picker not working

deur Liana Shpani -

Hello!

I am having this issue too, but the suggestions in this (and many other file picker not working forums) didn't fix it. I recently updated the test instance of Moodle to 3.5.1 and this issue appeared (not on the clean install, so it is definitely something in our code). It is not from the additional css as I tried removing it and the problem persisted. Then I updated the code to 3.5.2 and the issue persists, that just confirms that it's being caused by our code, but it wasn't there in the previous versions (3.3.2). 

A detail on the problem: the file pickers that didn't work were the ones that you see as an admin or teacher - as a student when you upload something to the assignment it works fine. 

Any ideas on what to try or what to be looking for that might have caused this? Thank you!! 

Best,

Liana

Gemiddeld van beoordelings: -
In antwoord op Liana Shpani

Re: Moodle file picker not working

deur Liana Shpani -

Something that I found while looking around: This error shows up in the console in the sites where the filepicker doesn't load... 

Aanhangsel Screen Shot 2018-09-10 at 10.30.05 AM.png
Gemiddeld van beoordelings: -
In antwoord op Liana Shpani

Re: Moodle file picker not working

deur John Byrne -

Is that the Javascript console on the client?  Or the /var/syslog?  Can you tell us more details about where you found that?


Thank you,

John Byrne

Gemiddeld van beoordelings: -
In antwoord op Taj Des

Re: Moodle file picker not working

deur Edwin Yeong -
Hi all,

I also faced this problem. The File Picker window just hang there. I check the log it says:
20900#0: *12738856 open() "/Media/Default/Images2019/SidebarsRefers/HDC-2019-Button.jpg" failed (2: No such file or directory)
Hope someone can help please.
Gemiddeld van beoordelings: -
In antwoord op Taj Des

Re: Moodle file picker not working

deur i an -

In my case it was clamd causing the issue, re-installing it sorted the problem (could test by temporarily disabling clamd on Moodle if you are running it)

Gemiddeld van beoordelings:Useful (1)
In antwoord op Taj Des

Re: Moodle file picker not working

deur elearning fmipaunmul -
Hi, i have a problem with file picker. I m using moodle 3.7.2 (stable version) with klass theme. This problem only on firefox but only other moodle is have a problem. My other moodle site in other server, didnt have this problem.satu
my second site has loading file picker

dua
but my other site doesnt have this problem.
i opened in same browser "firefox". both have same moodle version and theme.
Gemiddeld van beoordelings: -
In antwoord op elearning fmipaunmul

Re: Moodle file picker not working

deur Tim Hunt -
Prentjie van Core developers Prentjie van Documentation writers Prentjie van Particularly helpful Moodlers Prentjie van Peer reviewers Prentjie van Plugin developers
Are there any errors in the Console in the developer tools of your browser?
Gemiddeld van beoordelings: -
In antwoord op Tim Hunt

Re: Moodle file picker not working

deur Efraim Bayarri -

Same loader problem. The javascript console gives this problem

Aanhangsel Captura de pantalla -2020-04-14 10-51-25.png
Gemiddeld van beoordelings: -
In antwoord op Efraim Bayarri

Re: Moodle file picker not working

deur Diego - CMI FG -

hello everybody,

I have unset the "Cache Javascript" parameter in "Site administration -> Appearance -> AJAX and Javascript" and the file picker gone back to work well. But, according the parameter description, this is not recommended for live environments.

I Hope it can help.




Gemiddeld van beoordelings:Useful (2)
In antwoord op Tim Hunt

Re: Moodle file picker not working

deur Labinot Morina -

I have the same issue this is my error in my console


This error page has no error code in its security info aboutNetError.js:585:13
Uncaught DOMException: Permission denied to access property "document" on cross-origin object
Gemiddeld van beoordelings: -
In antwoord op Labinot Morina

Re: Moodle file picker not working

deur Patrick Felipe -
Hey how is everything?

I'm having the exact same problem, did you happen to find the solution?
Gemiddeld van beoordelings: -
In antwoord op Taj Des

Re: Moodle file picker not working

deur André Luiz França Batista -

Hello. 

Sorry to ressurect this post but I found myself facing this same issue.

Just for contribution. It turns out (in my case) the Adblock Google Chrome extension was blocking the file picker. Just whitelist your Moodle URL in the Adblock and it works for me.

Regards.

Gemiddeld van beoordelings:Useful (1)