Images and files not showing after upgrading from v3.5 to v3.8

Images and files not showing after upgrading from v3.5 to v3.8

augusto canessa -
回帖数:10

Hi,

I have upgraded from v3.5 (production) to 3.8 (development) and now images are not showing, and files like PDFs in courses are inaccessible. Examples as follow:


Development server (3.8 Build 20191129) - Not working.
PHP 7.2


images: http://cursos2020.centroredes.org.ar/pluginfile.php/46953/course/section/5250/Satelitales1.jpg

This link returns a blank image. no errors in server log. access log shows the following:
XXX.XXX.XXX.XXX - - [20/Dec/2019:15:43:23 -0500] "GET /pluginfile.php/46953/course/section/5250/Satelitales1.jpg HTTP/1.1" 304 295 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.79 Safari/537.36"

PDF: http://cursos2020.centroredes.org.ar/pluginfile.php/47251/mod_resource/content/1/clase-2.pdf


XXX.XXX.XXX.XXX - - [20/Dec/2019:15:44:48 -0500] "GET /pluginfile.php/47251/mod_resource/content/1/clase-2.pdf HTTP/1.1" 304 297 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.79 Safari/537.36"

Production server (3.5.5+) - Working.
PHP 7.0

images: http://cursos.centroredes.org.ar/pluginfile.php/46953/course/section/5250/Satelitales1.jpg

This link returns a blank image. no errors in server log. access log shows the following:
XXX.XXX.XXX.XXX - - [20/Dec/2019:15:43:23 -0500] "GET /pluginfile.php/46953/course/section/5250/Satelitales1.jpg HTTP/1.1" 304 295 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.79 Safari/537.36"

PDF: http://cursos.centroredes.org.ar/pluginfile.php/47251/mod_resource/content/1/clase-2.pdf


XXX.XXX.XXX.XXX - - [20/Dec/2019:15:44:48 -0500] "GET /pluginfile.php/47251/mod_resource/content/1/clase-2.pdf HTTP/1.1" 304 297 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.79 Safari/537.36"

Things that I have tried.
 - Slash arguments set to OFF, No change.
 - Double checking moodledata files and size. They are the same.
 - cgi.fixpathinfo = 1 on PHP INI. No change.
 - Made sure php7.2-gs (and others) is installed.
- I also tried changing the numerical values on URL and I get the following error, indicating that the IRL is correct and the file is probably(?) there.

Sorry, the requested file could not be found

More information about this error

Debug info:
Error code: filenotfound
Stack trace:
  • line 494 of /lib/setuplib.php: moodle_exception thrown
  • line 2074 of /lib/filelib.php: call to print_error()
  • line 4647 of /lib/filelib.php: call to send_file_not_found()
  • line 44 of /pluginfile.php: call to file_pluginfile()

I am not sure what else to try. I don't know if this is server related perhaps?

Any help would be appreciated! 


回复augusto canessa

Re: Images and files not showing after upgrading from v3.5 to v3.8

Acqua Alta -
Particularly helpful Moodlers的头像
I really don't know if that would work, but since you didn't mention it...

Did you try to purge caches in Moodle?
回复Acqua Alta

Re: Images and files not showing after upgrading from v3.5 to v3.8

augusto canessa -

Thanks. I did try. No change.

I also tried different php versions:

7.1, 7.2, 7.3, and 7.4. No change.

回复augusto canessa

Re: Images and files not showing after upgrading from v3.5 to v3.8

Adam Jenkins -
Particularly helpful Moodlers的头像 Plugin developers的头像
When you upgraded from 3.5 to 3.8, did you do so incrementally?

i.e. 3.5 → 3.6 → 3.7 → 3.8

Or did you go straight to 3.8, skipping 3.6 and 3.7?

If incrementally, were the images visible in either 3.6 or 3.7? If not incrementally, please try upgrading incrementally.
回复Adam Jenkins

Re: Images and files not showing after upgrading from v3.5 to v3.8

augusto canessa -

i did the upgrade from 3.5 to 3.8. i can't really go incrementally because of how we operate and use moodle in the company.

I wonder if this is server related? this is a dev server and the environment is not exactly the same as the prod one. Thanks!

回复augusto canessa

Re: Images and files not showing after upgrading from v3.5 to v3.8

Adam Jenkins -
Particularly helpful Moodlers的头像 Plugin developers的头像
Even when updating from 3.5 to 3.8, it's better to go through each version, even if for only a few seconds. 3.8 has different requirements (perhaps the most noticeable being PHP) to 3.5 and these requirements changed gradually with each version. Do you use Git to get your Moodle code? If not, you should look into it. IMHO, everyone should be using git as it's so much easier.

How is the dev server environment different? Apache vs Nginx? Http vs. Https? Do you have X-Sendfile configured (if so on both? Perhaps remove this).

The next thing I'd try is "Purge All Caches". Or, have you already tried this?
回复augusto canessa

Re: Images and files not showing after upgrading from v3.5 to v3.8

Ken Task -
Particularly helpful Moodlers的头像

+1 to Adam's suggestion about using git and stepping through each version ... and about your comment concerning corp. ... which do think will 'bend' ... corp or official (known to work) Moodle directions on upgrading?

As far as could it be server related ... yes ...

What's purpose of your dev system?  New plugins/themes is one thing ... updates and upgrades should be part of that purpose.   So yes, environment of dev should be as close as you can get it to production ... otherwise, what's the purpose? :|

Suggest going to production server now ... Site Admin, Server, Environment ... update component ... that look at versions of Moodle higher to see if production server checks out.   MySQL DB requirements/PHP versions/extensions, etc. shown on production needed you install/upgrade do whatever on dev.  Then you'll know for sure what one needs to do on production to make that smoother ... and you a 'hero'! 微笑

'SoS', Ken


回复Ken Task

Re: Images and files not showing after upgrading from v3.5 to v3.8

augusto canessa -

Thank you for your feedback!

My dev server is a clone of the prod server, as they are VMs. The only difference is that dev server is running PHP 7.1 while prod PHP 7.0.

 I use the dev server to add custom changes to the PHP code to adapt Moodle to our needs. And also to modify the theme. I've been doing this for 10 years and this issue with the images never happened before. 

It's hard for us to upgrade using each version because of how we operate and the resources that we have. I have upgraded before skipping versions and i never had an issue. Perhaps this time is different. Perhaps is the server, something that changes since I've made the clone.

I will keep working on it and let you know what I find. Thanks! 

 

回复augusto canessa

Re: Images and files not showing after upgrading from v3.5 to v3.8

Adam Jenkins -
Particularly helpful Moodlers的头像 Plugin developers的头像
You don't need to actually use every version, but it is better when upgrading to go through each version. If you use git, this is trivial to do.

If you must ignore this advice, then I recommend you budget plenty of time for troubleshooting... You'll need it.

You may have been lucky until now having little difficulty, but luck has a tendency to run out.

Good luck!
回复augusto canessa

Re: Images and files not showing after upgrading from v3.5 to v3.8

Visvanath Ratnaweera -
Particularly helpful Moodlers的头像 Translators的头像
> I use the dev server to add custom changes to the PHP code to adapt Moodle to our needs. And also to modify the theme. I've been doing this for 10 years and this issue with the images never happened before.

Many things have happened in the Moodle landscape during the last decade. You are faced with merging or porting your changes to the current release which is 3.8.