Tried to change site's url, now all images (on news feed + everywhere else) are showing up broken

Rishi B Posted in Technical Support 6 years ago

As the title says, I tried to change my site's url and somehow that change has caused all the images on my site to break. The only file I edited was configurations/ossn.config.site.php - I did not touch anything else in the filesystem or database, the only other change I made was to my site's dns records which is entirely outside of ossn. I tried flushing the cache and rebooting the server to no avail. I have checked ossn's errorlog as well as apache's errorlog but cannot find any errors. I think it may have something to do with caching because I am not receiving a 404 error when I try to hit an image. If somebody could please take a look, I would be eternally grateful - right now I'm just praying I don't have to reinstall OSSN from scratch =/. My site is at http://soulg.ngrok.io (username and password is "demouser").

Thanks!

Replies
German Michael Zülsdorff Replied 6 years ago

Having applied your comment photo changes I (demouser) posted a small duck avatar to your site and mine.
At first sight yours appears to be 1 byte longer (1226) than mine (1225) in the browser.

Find that file in your data directory and verify the size. If its size is 1225, too, something in your server's Output stream must add 1 byte.

Did you Change anything around Content-Header Code?

Edited:
I had another look into your broken image with a hexeditor now, and in fact the additonal byte is a hex 0a right in the beginning - so it seems you have added a linefeed somewhere in your php code which becomes part of the stream.
Same hex 0a problem with my zet image - hence it starts to make sense that all pics appear to be broken.

Edit 2:
Actually, we're getting these extra linefeeds with a lot of other requests, too. They simply don't hurt too much with plain ASCII text/html responses - that's why your site is basically running. But of course this is a no-go when it comes to binary data.
http://z-mans.net/ossn-reports/2958/extra-0a.jpg

us Rishi B Replied 6 years ago

I cannot post new photos. I have double checked my OSSN config and it's pointing to the correct path. The files are there in the filesystem, but I cannot load them in my browser. I think it has something to do with headers and/or caching, but I have no idea how to fix this. I've tried to inspect the traffic and these are the headers I see returned when I try to load http://soulg.ngrok.io/avatar/rishi/larger/6be0656c3829bc7abd21772b63f764d7.jpeg (for example) in my browser:

Cache-Control public
Content-Length 7593
Content-Type image/jpeg
Date Fri, 29 Jun 2018 15:26:25 GMT
Etag "77681527324385"
Expires Sat, 29 Dec 2018 16:26:25 GMT
Last-Modified Sat, 26 May 2018 08:46:25 GMT
Pragma public
Server Apache/2.4.7 (Ubuntu)
X-Powered-By PHP/5.5.9-1ubuntu4.22

I'm going to try Arsalan's suggestion of disabling all non-essential components shortly.

Indonesian Arsalan Shah Replied 6 years ago

Further can you verify if you can able to post new photos? if so then that means your server have cached your photos.

If you can not upload new photo, then try to disable all 3rd party components and verify it.

au Jason Jones Replied 6 years ago

Images are stored outside the OSSN installation directory, suggested folder name "ossn_data" however you may of changed this on installation.

Other data is stored in a separate database, that is why you're still seeing it.

Double check that ossn.config.site.php (/public_html/forum/configurations) is still pointing to what you have set.

EXAMPLE

$Ossn->userdata = '/home/servername/ossndata/';

Use FTP or cPanel to check that this directory exists, and that path is correct (as above). You should be able to drill down to check images while you are at it.

us Rishi B Replied 6 years ago

yes, it is. all of my data besides the images appears to be fine.

au Jason Jones Replied 6 years ago

Is ossn.config.site.php (/public_html/forum/configurations) still pointing to your data directory?

us Rishi B Replied 6 years ago

I should add that I tried to "undo" the change once this happened and reverted back to my old url, but that didn't fix the problem either, all images still show up broken (as you can see if you login to my site given above).

Premium Version

Due to the many requests in the past for additonal features and components we have decided to develope a premium version. Features like Hashtags, Videos, Polls, Events, Stories, Link Preview, etc included in it.

$199 (Life Time)
Learn More

Other Questions