File Upload Issue Moodle 3.10.01

File Upload Issue Moodle 3.10.01

by Wan Nur Azlan Wan Mohamad -
Number of replies: 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

Attachment Screenshot 2021-07-01 at 7.00.41 PM.png
Attachment Screenshot 2021-07-01 at 7.01.34 PM.png
Average of ratings: -
In reply to Wan Nur Azlan Wan Mohamad

Re: File Upload Issue Moodle 3.10.01

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of 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 reply to Howard Miller

Re: File Upload Issue Moodle 3.10.01

by 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 reply to Wan Nur Azlan Wan Mohamad

Re: File Upload Issue Moodle 3.10.01

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of 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 reply to Howard Miller

Re: File Upload Issue Moodle 3.10.01

by Wan Nur Azlan Wan Mohamad -
Yes. I did install mysqli extension for the php. Btw, the php version I used was 7.4 not 7.2 as mention in the beginning
In reply to Wan Nur Azlan Wan Mohamad

Re: File Upload Issue Moodle 3.10.01

by Leon Stringer -
Picture of Core developers Picture of 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.

Average of ratings: Useful (1)
In reply to Leon Stringer

Re: File Upload Issue Moodle 3.10.01

by 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

Attachment Screenshot 2021-07-03 at 10.54.21 PM.png
In reply to Wan Nur Azlan Wan Mohamad

Re: File Upload Issue Moodle 3.10.01

by 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
Attachment Screenshot 2021-07-03 at 11.13.03 PM.png
Attachment Screenshot 2021-07-03 at 11.13.17 PM.png