File Upload Issue Moodle 3.10.01

File Upload Issue Moodle 3.10.01

di Wan Nur Azlan Wan Mohamad -
Numero di risposte: 7

Dear all,

Kindly seek assistance from you guys as I'm fairly new to moodle. 

I just finished migrating moodle to our own local server which is running on Linux and PHP 7.2.

The issue I encounter was, whenever I want to upload a file, somehow there's an error inside the console.

Moodle is running on version 3.10.01 with moove theme

Allegato Screenshot 2021-07-01 at 7.00.41 PM.png
Allegato Screenshot 2021-07-01 at 7.01.34 PM.png
Media dei voti:  -
In riposta a Wan Nur Azlan Wan Mohamad

Re: File Upload Issue Moodle 3.10.01

di Howard Miller -
Immagine Core developers Immagine Documentation writers Immagine Particularly helpful Moodlers Immagine Peer reviewers Immagine Plugin developers
The syntax error is usually because an error message is being returned instead of JSON data. You should start by checking your web server's error log. Hopefully, the error will also have been logged there. It won't hurt to switch on Debugging.
In riposta a Howard Miller

Re: File Upload Issue Moodle 3.10.01

di Wan Nur Azlan Wan Mohamad -
I managed to turn on the debugging to developer mode. the following error encounter:-

[01-Jul-2021 13:15:09 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'mysqli' (tried: /usr/lib/php/20190902/mysqli (/usr/lib/php/20190902/mysqli: cannot open shared object file: No such file or directory), /usr/lib/php/20190902/mysqli.so (/usr/lib/php/20190902/mysqli.so: undefined symbol: mysqlnd_global_stats)) in Unknown on line 0
In riposta a Wan Nur Azlan Wan Mohamad

Re: File Upload Issue Moodle 3.10.01

di Howard Miller -
Immagine Core developers Immagine Documentation writers Immagine Particularly helpful Moodlers Immagine Peer reviewers Immagine Plugin developers
Strange. I take it you are using mysqli for database access? But.... this would imply that Moodle wouldn't work at all.
In riposta a Wan Nur Azlan Wan Mohamad

Re: File Upload Issue Moodle 3.10.01

di Leon Stringer -
Immagine Core developers Immagine Particularly helpful Moodlers

If you switch from the error console to the Network tab you should be able to see the background requests being made for the upload. Click on these requests to see the server's response. There'll probably be a response that's an HTML page from the server probably containing an error. Moodle is expecting the server to send JSON only.

Is the SyntaxError: Unexpected token error occurring immediately when the upload starts or after a while, for example 30 seconds? This error can occur when a large file is being uploaded and the web server connection times out. If it does look like a timeout the first thing to check is whether PHP's max_execution_time is being exceeded. If the problem persists please tell us more about the web server: is it Apache, Nginx or something else?

You should be able to work around this problem by using the command line interface to restore courses.

In riposta a Leon Stringer

Re: File Upload Issue Moodle 3.10.01

di Wan Nur Azlan Wan Mohamad -

Below is the tab for Network.

The error occurs instantaneously after I click the upload button. 

The web server is running on apache (version 2.4.41)

Thanks for, insight on the alternative restore guide. However, I still need to get the upload issue as this affects all moodle features that are involve with file uploading

Allegato Screenshot 2021-07-03 at 10.54.21 PM.png
In riposta a Wan Nur Azlan Wan Mohamad

Re: File Upload Issue Moodle 3.10.01

di Wan Nur Azlan Wan Mohamad -
UPDATE:

In upload user section, I tried to upload a pdf file instead of csv. Somehow, the pdf has no issue.

My csv only contains the following

username,firstname,lastname,email
student1,Student,One,s1@example.com
student2,Student,Two,s2@example.com
student3,Student,Three,s3@example.com
Allegato Screenshot 2021-07-03 at 11.13.03 PM.png
Allegato Screenshot 2021-07-03 at 11.13.17 PM.png