Missing profile pics after upgrading from 2.7-3.2-3.7

Missing profile pics after upgrading from 2.7-3.2-3.7

by Ian L -
Number of replies: 20

The upgrade seems to be o.k. but it's missing profile photos. There isn't even the default blank profile pic that comes with moodle.

For example:

missing profile pic

I checked the config.php and everything seems fine. 

Other photos in the course seems to be showing just not the profile pics.

I read a few other related posts but can't figure it out.

I still have the old installation with functional pics, so if there is another way to get them from that it would be great.


Average of ratings: -
In reply to Ian L

Re: Missing profile pics after upgrading from 2.7-3.2-3.7

by Ian L -
Actually I was wrong I am missing more than just profile pics. I am missing all pics that were not put in the image folder that I had created. 
In reply to Ian L

Re: Missing profile pics after upgrading from 2.7-3.2-3.7

by Ken Task -
Picture of Particularly helpful Moodlers

This 'image folder' you mention ... that a folder in Moodle created inside Moodle Admin interface or a folder you created in apache/web server?

Generally, all files uploaded to moodle in the Moodle UI are in moodledata/filedir/

What are ownerships/permissions on filedir recursively?

See anything in web server logs (error) that might provide a clue?

Any changes to other software that protects ... like mod_security or seLinux (on CentOS/RHEL systems)?

'SoS', Ken

In reply to Ken Task

Re: Missing profile pics after upgrading from 2.7-3.2-3.7

by Ian L -

I made a folder in /moodle/images/myimage1.png

I think I might ave had this problem last time I upgraded and I couldn't just copy an image path and paste it somewhere without making and error, so that's why I created a folder.

But.

That's not my problem.

Why would an image in the html block not show, but when I go to edit it (configure block) then I could see it?! But then when I close it again it's gone!

In reply to Ian L

Re: Missing profile pics after upgrading from 2.7-3.2-3.7

by Ian L -

It's getting weirder. 

I started to compare the orginal moodledata folder and the new one and there was a huge difference in size 156mb to 6mb - maybe because of my bad internet now. 

so the new one was incomplete, but when I used the OG moodledata folder I still got the same problem, BUT when I go into the HTML block where one of those missing photos is to edit it and then pic shows, but when I close the editor it doesn't!

i have checked persmissions and cant get why moodledata will work with one installatio the old 2.7 but not hte new.


In reply to Ian L

Re: Missing profile pics after upgrading from 2.7-3.2-3.7

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Did you move moodledata as part of the upgrade?
In reply to Howard Miller

Re: Missing profile pics after upgrading from 2.7-3.2-3.7

by Ian L -
I did from /public_html/ to / but I put it in the config file and then I moved the old installation to a new location and changed the config file and it still works as long as cloudflare is not enabled.
In reply to Ian L

Re: Missing profile pics after upgrading from 2.7-3.2-3.7

by Ken Task -
Picture of Particularly helpful Moodlers

cloudflare ... that's new info and sounds like involved in the issue.

CF caches ... CDN ... supposed to intercept request to your server and serve out what's in it's cache/CDN to make if faster for clients.

Can see CDN if one has a lot of locally stored videos and rich media but if it's gonna create problems for things like user icons ... something that small ... have to ask myself ... is CF worth it?

'SoS', Ken


In reply to Ian L

Re: Missing profile pics after upgrading from 2.7-3.2-3.7

by Ken Task -
Picture of Particularly helpful Moodlers

CF Additional ... dunno if this simple CF bypass will work or not ... depends upon providers set up for CF/customers ...

CF has DNS trickery - so if provider hasn't done a 'deep dive' into setup of CF for your site, the following might provide at least some clues:

Since you are remotely hosted you can see the true IP address of
your server.

Via ssh ... ifconfig [ENTER]

Looking for the public IP address assigned by provider.

On your workstation ...
If you can edit your hosts file on your PC/Mac you can map your
servers FQDN with it's true IP.  All computers check the host file first
before DNS.

So going now to your site with host file mapping isn't going to DNS
but will use the IP address in your host file.

Images show?

What does console turned on look like?

There is software for CF discovery, etc.  .... even some stuff one could install on your  server ...

https://rhinosecuritylabs.com/cloud-security/cloudflare-bypassing-cloud-security/

https://opendatasecurity.io/how-to-bypass-cdn/

Your mileage might vary! :|

'SoS', Ken


In reply to Ian L

Re: Missing profile pics after upgrading from 2.7-3.2-3.7

by Ken Task -
Picture of Particularly helpful Moodlers

You've shared your site before in forums ... or at least one site.
Is this your site?

www.course.e5.com

I get:

Unable to communicate securely with peer: requested domain name does not match the server’s certificate when using https://

That would mess up communications between cloudflare and your server as well as confuse urls to images, etc.

'SoS', Ken


In reply to Ken Task

Re: Missing profile pics after upgrading from 2.7-3.2-3.7

by Ian L -
No that's not my site. I'd rather not share it here. I don't think the problem is cloudflare because I disabled it and the old installation which i moved to a new location (config.php is correct) is working with it's disabled.
In reply to Ian L

Re: Missing profile pics after upgrading from 2.7-3.2-3.7

by Ken Task -
Picture of Particularly helpful Moodlers

Nothing like attempting to assist someone with problems and trying to 'fill in the blanks' via Vulcan Mind Meld  ... but .... such is public forums. :|  Understood.

Ok, quick review ...

You upgraded a site from 2.7.x through 3.2.highest then onto 3.7.highest.

(I take it you stopped at the 3.2.highest and checked things out ... backed up code + DB ... when everything was checked out, then onto 3.7.highest.  Images now missing were present)

You did so using the old method of moving moodle code directory out of  the way, unzipping the moodle code zip, copying back in config.php from code directory moved.

At that point things were fine except images ...

Well, the manually created images directory needed to be moved back into new moodle code from old moodle code.

Am guessing ... because you've shown /public_html/ in paths ... that you don't have to be concerned about username/group on files/folders in new code.

moodledata was in public_html and you moved to /srv/home/customerID/ or something like that ... that's your '/' (root of your account).   moodledata has an .htaccess file in it.

since moodledata has been moved, did you tell apache that it could access moodledata via some addiitonal config of apache?

There was no duplicate moodledata directory remaining from a upgrade that went sour?

What would happen if you moved moodledata back to it's original location?  The hidden .htaccess file should be enough to protect from direct browsing.

???? with CloudFlare off, the site works!!!   Hmmmmmm ...

'SoS', Ken


In reply to Ken Task

Re: Missing profile pics after upgrading from 2.7-3.2-3.7

by Ian L -
I don't think it's cloudflare because I disabled it and the old installation works if it's disabled and the new installation seems unaffected disabled or enabled..

The weird thing is that when I click to edit where the missing image is I can see it in the editor, but when I close it it's gone.

Is this some sort of permission thing? I compared the permissions on the folders and config file between the old and new but they are all the same. But I was wondering if there is some sort of permission thing or setting within Moodle that needs to be changed.
In reply to Ken Task

Re: Missing profile pics after upgrading from 2.7-3.2-3.7

by Ian L -

I said cloudflare seems to only affect the "old" installation that I moved to a new directory.

I just unchecked "use slash arguments" and my profile pic shows! 

But other images are still not.

In reply to Ian L

Re: Missing profile pics after upgrading from 2.7-3.2-3.7

by Ken Task -
Picture of Particularly helpful Moodlers

Ok, ignoring some questions ... so ...  we'll try to move foward ...

"I just unchecked "use slash arguments" and my profile pic shows! "

Ok, good ... partial solution ... indicates apache (or nginx config).  Profile  pic coming meta data in DB to gen url to image that browser understands and can display.

So now it's other images not showing ...   all files that are uploaded to moodle are stored in moodledata/filedir/

Ownerships/permissions on moodledata recursively have been checked and they are ok.

So where, in your user space, are:

1. the manually created directory that you made with images  in it - the full path to that directory.

2. the full path to moodledata

Also ... have we thought about turning on debugging?

have we checked web server logs?

Yes, know that when you edit, image shows ... save and image disappears.

Please answer the questions above.

Also ... consider sharing with me the url to your site via private messages in this forum.

Ken


In reply to Ian L

Re: Missing profile pics after upgrading from 2.7-3.2-3.7

by Ken Task -
Picture of Particularly helpful Moodlers

Have you checked to see if your cron job is running correctly? and often?

Ken

In reply to Ken Task

Re: Missing profile pics after upgrading from 2.7-3.2-3.7

by Ian L -
Yeah I thought about that. I don't know what it does.

I think it's something with the editor. I attached a pic and you will see that even though there is content in the block editor it won't show when closed.


Outside it doesn't

In reply to Ian L

Re: Missing profile pics after upgrading from 2.7-3.2-3.7

by Ken Task -
Picture of Particularly helpful Moodlers

In the tool bar of the editor, click the first icon of the atto editor (looks like a right angled down arrow) to show more editor tools.

Click the button that looks like <>

Screen shot of what you see there.
Note the filename of the image.

Save.

Go back to browsing the course and when viewing the page with FireFox.  from Firefox menu, choose Tools -> Web Developer -> View page source.

That should open in a new tab and shows the html of the page.

When viewing page source, do a find ... look for 'img' without quotes
so we can see the html tagging for images ...

should find/look like (broken here so it won't link):

< img src=" https:// sos.sosoftexas.org/moodle37/pluginfile.php/114/block_html/content/moodle2018badge.png" alt="" role="presentation" class="img-responsive atto_image_button_text-bottom" width="100" height="100" > < br >

What does yours show?

So far, we've not answered almost all questions I have asked.

Failure to answer any more and I'm outta here!  Not angry ... just don't have time to waist any more!

Ken


In reply to Ken Task

Re: Missing profile pics after upgrading from 2.7-3.2-3.7

by Ian L -
The links are in the editor. And I just logged as a different user and I can see the images! But with my account as admin I cannot.
In reply to Ian L

Re: Missing profile pics after upgrading from 2.7-3.2-3.7

by Ian L -

These are the errors on that image when I right click.

  • line 92 of /lib/classes/session/manager.php: core\session\exception thrown
  • line 794 of /lib/setup.php: call to core\session\manager::start()
  • line 27 of /config.php: call to require_once()
  • line 32 of /pluginfile.php: call to require_once()

In reply to Ian L

Re: Missing profile pics after upgrading from 2.7-3.2-3.7

by Ian L -
Problem solved. For now anyways. I created a new account as a test and realized that new accounts people could see the images. But I couldn't see th eimages and old user accounts people couldn't see the images.

I tried the changing the slasharguments setting and that didn't work either. Finally I cleared the cache again in my browser and it they show. I previously had purged moodle's cache a bunch and my browser's too.

I don't know why, but it wasn't the first time I tried, but it worked this time, hallaluyah^^.
Average of ratings: Useful (1)