User download problem

User download problem

per Aditya Dubay -
Nombre de respostes: 10

Hi,

I am using Moodle 2.5.5

When I try to download users as excel document it downloads 0 byte file and not open.

What to do Trist


Aditya

Mitjana de qualificacions: -
En resposta a Aditya Dubay

Re: User download problem

per Aditya Dubay -
En resposta a Aditya Dubay

Re: User download problem

per G. M. -

Hi Aditya,

I don't think that's a Moodle issue. I'd say that maybe something else is interfering, like:

1. Antivirus software.

2. A browser plugin.

3. Malware.

4. Web server/php wrong setting (e.g. mime).

The usual recommendation applies:

1. Enable Debugging.

2. Check the web server error log.

En resposta a G. M.

Re: User download problem

per Aditya Dubay -
Hi Guillermo,

Thanks for reply.

01. Anti virus may be not the issue as downloading works before and now it wont and we did not made changes in AV.
02. There is no external plugin in browser and I tried on ie, crome and firefox.
03. Malware on machine?? I already checked and thats not an issue.
04. We recently shift from one server to another and it problem comes after that so I feel this may be cause of problem. Can you please explain this point so that we check at server end.
05. We enabled debugging at developer level and repeat the download process but it shows nothing, so we feel that is also not an issue.

Waiting for needful help Somrient

Regards,
Aditya
En resposta a Aditya Dubay

Re: User download problem

per G. M. -

Hi Aditya,

What about the web server error and access logs? You'll get more info in them.

In the web server access log you should be having a line like this:

someip - - [date:time -timezoneoffset] "GET /yourmoodledirectory/admin/user/user_bulk_download.php?format=xls HTTP/1.1" 200 the-actual-file-size-in-bytes

The 200 code is the standard response for a successful HTTP request, that is, it indicates everything went fine.

While you have discarded many possible sources of problem, it's difficult to pinpoint where the problem might be, specially without error/warning messages; anyway, here are some ideas to check or try:

*** In Moodle:

* try downloading the user data in the other available formats (txt, ods).

* log as a different admin user and retry the excel download.

* can you download other excel formatted data, like grades?

*** In the OS, check that:

* the temporary directory is there and writable, and that you have enough disk space.

*** In the mime.types configuration file (at the Apache conf configuration directory), check that:

* the ms-excel line is uncommented, like so:

application/vnd.ms-excel xls xlm xla xlc xlt xlw

(http://www.iana.org/assignments/media-types/media-types.xhtml)

*** In httpd.conf, check that:

* ErrorLog and CustomLog are set with valid paths.

*** In php.ini, check that:

* open_basedir is disabled (commented).

disable_functions doesn't list readfile().

log_errors is set to On and error_log is defined with a valid path.

max_input_time has an acceptable value (e.g. 60 or 120 seconds).

---

Given that the problem started after moving to another server, maybe you could try and compare all the related web environment configuration files, that is, if you still have access to the old server.

En resposta a G. M.

Re: User download problem

per Aditya Dubay -

Hi Guillermo,

Thanks for useful reply.

I do not have cpanel access till now, once I got I check logs in it Somrient

Also I ask my server provider to made changes you suggest in reply Somrient

About other format: Yes it is downloadable in other format but with the help of this forum we made some changes in user_bulk_download to get first access and last access details of user. If you wish to see I will share that file with you.

About other things like Grade: No I am not able to download grades or responses too in excel.

Thanks

Aditya

En resposta a Aditya Dubay

Re: User download problem

per G. M. -

Hello Aditya,

Thanks. Well, it seems then to be a server configuration problem, given that you cannot download grades neither. I assume that you have made sure that the modifications made to the script didn't actually brake the excel file handling. I would restore the original file and retry the download process, just to be sure Somrient

En resposta a G. M.

Re: User download problem

per Aditya Dubay -

Hi Guillermo,

Yes we are sure that modifications made to the script didn't actually brake the excel file handling as it was working on old server.


Thanks,

Aditya

En resposta a Aditya Dubay

Re: User download problem

per G. M. -

Well, let's hope that your server hosting provider solves this soon.

Cheers! Somrient

En resposta a G. M.

Re: User download problem

per Aditya Dubay -

Hi Guillermo,

My server provider tell me this:

01. On server does temporary directory exist and is is writable or not??

/tmp folder exist on server and is writable.

 

02. In MIME types configuration file (At Apache conf configuration directory) line "application/vnd.ms-excel xls xlm xla xlc xlt xlw" must be active (uncommented).

MIMEType exists:-

application/vnd.ms-excelxls xlm xla xlc xlt xlw


03. In httpd.conf we need to check that ErrorLog and CustomLog are set with valid paths.

Please check error logs in specific application folders i.e.:-

public_html/mysite/error_log

public_html/mysite2/error_log

 

CustomLog are set with:-

access-logs/mysiteurl

 

04. In php.ini file we need to check these things:

- open_basedir is disabled (commented).

Disabled

- disable_functions doesn't list readfile().

Not Disabled

- log_errors is set to On and error_log is defined with a valid path.

Please check error logs in specific application folders i.e.:-

public_html/mysite/error_log

public_html/mysite2/error_log

- max_input_time has an acceptable value (e.g. 60 or 120 seconds).

max_input_time = 60

and I replace the modified file with the original one but still I am getting the same issue.

Both files are attached with this post, please suggest the solution.


Aditya

En resposta a Aditya Dubay

Re: User download problem

per G. M. -

Aditya,

To avoid having to read a thin strip I'm continuing here your last post.

1. Did you log as a different admin user and retry the excel download? You didn't mention anything about this one.

2. Now that you have access to the web server (and PHP) logs, try each and every Moodle Excel download (e.g. users, grades, logs) and check all the logs. You should find the related messages. As I previously mentioned, a successful entry looks like this:

someip - - [date:time -timezoneoffset] "GET /yourmoodledirectory/admin/user/user_bulk_download.php?format=xls HTTP/1.1" 200 the-actual-file-size-in-bytes

By the way, in these settings:

public_html/mysite/error_log
public_html/mysite2/error_log

"error_log" is a directory and not a file; is that right?

3. One other possibility would be that of an interfeering settings file, like an extra php.ini or an .htaccess (dot htaccess) file in a directory included in the system path. Please see:

http://docs.moodle.org/25/en/PHP

Maybe it would also be worth checking this one: 

http://docs.moodle.org/25/en/Security_overview_report

4. Another idea. Using the same Moodle package you used for your current site, do a new Moodle installation at the new server and, without changing any Moodle settings, code, etc., repeat the user download process. You could then add a couple of users and repeat the download process.

 

So:

1) you just moved your Moodle site to another server that is supposed to have the same (or better) capabilities as the old one (I assume that the minimum requirements for your Moodle 2.5.5 version are met);

2) the migration process was done as recommended;

3) nothing else was changed; and,

4) since then the Excel download process stopped working.

 

Well, given all the checking done, I guess I stand with the last advice given:

"try and compare all the related web environment configuration files, that is, if you still have access to the old server."