Various problems after changing hosts

Started by epikurieu, October 25, 2018, 03:31:31 PM

Previous topic - Next topic

epikurieu

Hi, I'm having some trouble with my forum after changing hosts.

Both are shared hostings; I moved from 1&1 to OVH. SMF SMF 2.0.15, many mods installed, SSL enabled. Forum URL : https://www.neuronesconnection.fr/

First is a problem with avatars: I can't upload an avatar from my computer. When I try, there is no error message, no apparent problem, only no image is uploaded and the option "no avatar" is selected instead of "transfer an avatar".

       
  • I tried running repair_settings.php, with various options.
  • I tried selecting the attachment folder for the avatars as well as a cutomized folder.
  • I checked the files permissions a hundred times (and ran the tool for using a prefefined set of permissions, standard option)
  • It's not a display issue, I checked with Filezilla, no file were uploaded anywhere.
  • By the way, attachments are not uploader either.
  • I don't think it's related, but at fisrt there was a problem with the existing avatars (not showing), which I solved by downloading them again from the old host in binary format (found the solution in this forum).
  • I tried supressing the size limits for the attachments.
  • I checked the members groups permissions.
None of these solved the problem, obviously.
Second is a strange behaviour with unread topics.

       
  • When I click on "latest posts" (/unread/?all), the topics with new posts are shown, but only three by three max (so for 12 topics with new posts, I have 5 pages of results), which wasn't the case before.
  • When I click on the topic and read the new message, at first it disappears from the list like it should.
  • But then it gets tricky: if I click on "mark all the posts as read", they all disappear from the list and I get redirected to index.php, BUT the icons on the left are those for unread topics. But if I click on one of them, I get a message saying that there are no unread topics.
  • And finally, after a while (maybe 15 minutes or even less), all the topics previously marked as read (or visited) are back on the list (/unread/?all) (even if nobody posted there, obvioulsy).
Lastly, one of my users has an identification problem: he has to log in every time he comes back. But this was already the case before I changed hosts.
That's all the problems I get (for now...), I hope some of you can be of help... :)

epikurieu

(I attached an empty txt file to my previous post, to check how it works here. So I had confirmation that it should on my forum, since everything look identical.)

Kindred

"many mods installed"

Please list your mods (in text, not a screen shot, please)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

epikurieu

Here you go; I left the updates so that you wouldn't wonder about the missing numbers. ;)

1.    Additional Membergroups on Profile    1.1.2
2.    Simple ImageShack    3.1.3
3.    Vote polls with points    0.1.3
4.    View Voters at Polls    1.0
5.    SMF 2.0.14 Update
6.    Simple Hide BBC - Hide the Goodies from Lurkers    1.0
7.    SMF External Image Proxy    1.0.0
8.    SMF 2.0.7 Update
9.    PM Attachments    2.10
10.    SMF Multi Quote    1.1.3
11.    SMF 1.1.20 / 2.0.9 Update
12.    Pretty URLs    1.0
13.    SMF 2.0.5 Update
14.    SMF 1.1.20 / 2.0.9 Update
15.    SMF 2.0.11 Update
16.    Audio and Video BBCodes    1.0 beta 1
17.    Tabbed smileys    0.3.99b
18.    Today's Posts    1.1
19.    Enhanced About Page    0.02
20.    Hide Post    1.1
21.    SMF 2.0.8 Update
22.    Simple Audio Video Embedder    4.4
23.    SMF 2.0.5 Update
24.    SMF 1.1.19 / 2.0.6 Update
25.    Profile Comments    2.0.2
26.    Users mass actions    0.1.1
27.    SMF 1.1.20 / 2.0.9 Update
28.    SMF 1.1.20 / 2.0.9 Update
29.    Reason For Editing Mod    2.3.2
30.    Google Analytics Code    1.4
31.    SMF 2.0.12 Update
32.    SMF 1.1.21 / 2.0.10 Update
33.    Play Media Attachment    2.3
34.    Drafts    1.1.2
35.    Search Topic And Boards Button    1.0
36.    Disable Subject Change    2.0.1
37.    Ignore Topics    2.3
38.    SMF 2.0.15 Update
39.    Aeva ~ Auto-Embed Video & Audio    7.2
40.    Quick Spoiler    0.9.4
41.    TopicRenamer    2.2
42.    SMF 1.1.20 / 2.0.9 Update
43.    SMF 1.1.20 / 2.0.9 Update
44.    Reply Button in All Posts    1.1
45.    Moderator and Administrator Comment Tags    1.8.1
46.    SMF 2.0.13 Update

Kindred

you realize that you have the 2.0.9 update in there 6 times??  That can't be good or right. :(

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

epikurieu

:o I must admit that I hadn't paid attention to that! (I believe that there was a time when the updates weren't shown in this list)

And what does it mean, an update installed several times? I thought an update meant some changes in files... ???
How could that happen and how can I fix it?

GigaWatt

Quote from: epikurieu on October 25, 2018, 05:16:48 PM
And what does it mean, an update installed several times?

You've installed the same update several times.

Quote from: epikurieu on October 25, 2018, 05:16:48 PM
I thought an update meant some changes in files... ???

Yes, most updates just patch files. That's the problem, a file can be patched several times with the mod installer. You might have several identical code instances one after another in some of the forum's files :S.

Quote from: epikurieu on October 25, 2018, 05:16:48 PM
How could that happen and how can I fix it?

The easiest solution - a clean set of files. You'll loose all of your mods, but you can install them again afterwards ;).
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Illori

it does not always mean the patch has been installed multiple times, it may just mean somehow the patch got uploaded to the package manager several times. the only way to know for sure is to manually parse the patch and check your files to see if the changes appear more then one time. if they dont then you can delete the duplicates in the package manager.

epikurieu

So I checked: indeed, it was only that the package was duplicated in the folder. I don't know how it happened... but anyway I checked the files and the code was never duplicated.

As I looked at the list of packages, I realized that some of them were not installed, they're only present in the folder because I tried them but then uninstalled them.

So here's the real list :

1.    Additional Membergroups on Profile    1.1.2
3.    Vote polls with points    0.1.3
4.    View Voters at Polls    1.0
5.    SMF 2.0.14 Update
6.    Simple Hide BBC - Hide the Goodies from Lurkers
7.    SMF External Image Proxy    1.0.0
8.    SMF 2.0.7 Update
10.    SMF Multi Quote    1.1.3
11.    SMF 1.1.20 / 2.0.9 Update
12.    Pretty URLs    1.0
13.    SMF 2.0.5 Update
14.    SMF 2.0.11 Update
15.    Audio and Video BBCodes    1.0 beta 1
16.    Tabbed smileys    0.3.99b
17.    Today's Posts    1.1
18.    Enhanced About Page    0.02
19.    Hide Post    1.1
20.    SMF 2.0.8 Update
21.    Simple Audio Video Embedder    4.4
22.    SMF 2.0.5 Update
23.    SMF 1.1.19 / 2.0.6 Update
24.    Profile Comments    2.0.2
25.    Users mass actions    0.1.1
26.    Reason For Editing Mod    2.3.2
27.    Google Analytics Code    1.4
28.    SMF 2.0.12 Update
29.    SMF 1.1.21 / 2.0.10 Update
31.    Drafts    1.1.2
32.    Search Topic And Boards Button    1.0
33.    Disable Subject Change    2.0.1
34.    Ignore Topics    2.3
35.    SMF 2.0.15 Update
36.    Aeva ~ Auto-Embed Video & Audio    7.2
37.    Quick Spoiler    0.9.4
38.    TopicRenamer    2.2
40.    Moderator and Administrator Comment Tags    1.8.1
41.    SMF 2.0.13 Update

GigaWatt

Hmmm... just read the first post entirely.

Quote from: epikurieu on October 25, 2018, 03:31:31 PM
I don't think it's related, but at fisrt there was a problem with the existing avatars (not showing), which I solved by downloading them again from the old host in binary format (found the solution in this forum).

Did you do the same for the forum's files?

See, there was this one time, I tried being really "smart" (::)) and tried to convert all of the forum's files to have a CR + LF line endings ::). A dumb decision I might add. Anyhow, I ended up with a semi-functional forum while I was about half way through. Plainly speaking, a lot of things didn't work.

This might be a similar scenario, but on a smaller scale (the number of affected files is smaller). Download the forum's files again in binary mode and upload them, once again, in binary mode, see if that fixes it ;).
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

epikurieu

I don't know what "CR + LF line endings" are (I'm French and I'm not a developer ;)) but I get the idea. :) I'll try this and I'll let you know.

GigaWatt

CR - Carriage Return, LF - Line Feed. They are remnants from the typewriter days. You have to feed a new line, then return the carriage... though things are the other way around with computers, that's why it's CR + LF, not LF + CR.

See, different operating systems use different byte combinations to represent a line ending and a new line in a text file (the thing that happens when you hit Enter on the keyboard when you're writing something in a text file). Linux uses the CR byte (it's actually 0x0D in hexadecimal) to represent an ending of a line and a new line, Mac uses LF (0x0A) and Windows uses both bytes (CR + LF, which means 0D followed by 0A).

And that's why it's called CR + LF file corruption. When in ASCII mode, FTP programs try to "convert" the text files to a format that their host OS will understand... in short, if you're using an FTP program under Windows, if transferring in ASCII mode, the FTP program will try to convert all line endings of text files (or what the FTP program thinks it's a text file ::)) to line endings compatible with Windows, i.e. CR + LF line endings, so you could easily open that text file with Notepad and not have to download an additional program like Notepad++. And basically, that's the problem, the FTP program will in some cases make a mistake and convert files that are NOT text files, so unintentionally, it will corrupt the file.

And that's why it's always advisable to transfer files in binary mode, not Auto or ASCII mode ;).
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

epikurieu

OK, thanks for the explanation. I have heard of this problem before, but you gave useful details to understand (and now I get the abbreviations ;)).

So I downloaded and uploaded again all the files in binary mode, but unfortunately that didn't solve the problems. :(

epikurieu


epikurieu

It's getting worse, now I only have 2 topics showing  in each section...

drewactual

what is your PHP configuration? 

I'm not talking version of package such as 5.6, 7.0, ect.. I'm talking how is it built? 

for instance, i have a server running FPM-PHP, which uses a pre-set number of workers... Another, say FastCGI, doesn't have a pre-set number of workers but spawns them as needed.  there are advantages and disadvantages to both and the several other flavors available.  The value this point brings to the conversation here is this:  SOME flavors of PHP packages require permissions set to 'users', while others can operate (actually require) as 'user: anonymous'... this doesn't seem like a big deal and it isn't, UNLESS you're SMF has created and references files with permission's set one way, and you move servers or implement a different flavor of PHP that needs permissions set the other way... Avatars, for instance, can be saved with permissions 'user', but the new flavor of PHP requires they have permissions as 'anonymous' for SMF to be allowed to load them... Same with sessions if you're using flat files... same with attachments... images of any kind...

the flavor of PHP you're using, especially if you moved servers where a different flavor is running, needs to match permissions to users...

a way of sniffing this out is by looking at one of your uploaded avatars on the server- see if it allows user 'anonymous' or 'user'.... upload a new one, and see how the permissions are set on the new one as compared to the old. 

Illori

I bet the OP is using shared hosting and has no idea how the server is configured.

drewactual

Quote from: Illori on October 30, 2018, 10:25:41 AM
I bet the OP is using shared hosting and has no idea how the server is configured.

i agree but i was hoping my comment would present them with enough information to know what to ask the host...

Illori

then it is easier to ask the op, can you ask your host if php is running in x mode or y.

drewactual

or, they can think for themselves and figure out to ask, or if not hosted via shared they can check it themselves, and they don't have to disclose their setup....

GigaWatt

Quote from: epikurieu on October 30, 2018, 07:43:19 AM
So, any idea to help me?

Quote from: epikurieu on October 30, 2018, 07:57:26 AM
It's getting worse, now I only have 2 topics showing  in each section...

Could you set up a free hosting account on a free host, run repair_settings.php on it and see if you get the same result? You don't have to upload the attachments in the attachment dir, just the .htaccess and index.php files.

Just to rule out server config, though, as drewactual said, this is the likely scenario at this point.
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

epikurieu

Quote from: Illori on October 30, 2018, 10:25:41 AM
I bet the OP is using shared hosting and has no idea how the server is configured.
Indded, I said it in my first post. I am not an expert of hosting and servers, sorry... I did some research and if I understood right, PHP flavors are used in cloud hosting, right? Mine is not a cloud hosting, it's a shared server in a physical datacenter, as I understand it. So I don't know if all this applies in my situation... ???

Anyway, I tried to set up another copy of the forum on an old free hosting I have, but I get a 500 error which I don't know how to solve, and I'm getting a bit downhearted here. :(

And what if the hypothesis were right and it were because of the server config? What would the solution be? Fresh install? I might as well do it right away, shouldn't I?

Sir Osis of Liver

Quote from: GigaWatt on October 25, 2018, 09:35:40 PM
The easiest solution - a clean set of files. You'll loose all of your mods, but you can install them again afterwards ;).

^ Do this, you're not going to fix it any other way.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

GigaWatt

Quote from: epikurieu on October 30, 2018, 05:16:55 PM
And what if the hypothesis were right and it were because of the server config? What would the solution be? Fresh install? I might as well do it right away, shouldn't I?

Do a fresh install, create some boards, also create some users, post some topics, etc., and see if the problems are fixed. If everything seems OK, delete everything (the test install) and do what I posted previously (what Sir Osis of Liver quoted ;)).
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

drewactual

the 'flavor' i speak of is how apache is configured- and is dependent on how the hosting company arranged it.   many of the functions can coexist on a configuration, but others can't- they conflict- and because of which hosts will eliminate one or the other.  HERE is a brief discussion with links available to further understand, if it is something you find interesting: https://www.howtoforge.com/community/threads/help-choosing-php-mode-php-fpm-suphp-mod-php-fast-cgi.63893/

a server error log should demonstrate the fault as 'requested file by user ---- denied by server configuration' or something to that impact...

IF it worked on one server but not another, and that fault is present and obviously permissions based, then it's most likely what i suggest... FPM-PHP is controlled at the domain level, which means your server manager can recover it for you, where as FastCGI and, say, SuPHP CANNOT run together, and is handled at the server level.   

spelling it out for you, if you were to ask your host:
- to see the error logs or ask if the error's present are permissions based where either 'anonymous' or 'user' is being denied
- to either turn FPM on or off for your domain depending on the above question
- if running FastCGI to run FPM alongside it; if running SuPHP to run mod_fcgi and w/ anonymous allowed as user in the php.ini file (SuPHP doesn't allow 'downwind' .ini files or htaccess files for domains). 

I feel for you, Sir- digging around in server configs or hoping your host has enough interest to focus on a single client to smooth the running after a move is a real PITA, and it's often difficult to find hard cold answers. 

epikurieu

So I tried to find some information, here is what I gathered:

       
  • I can choose between FPM on and off
  • as I understand it, if FPM is on, FastCGI is off
  • these options are handled in a config file, I'll attache a file with details
I can choose between several environments: https://docs.ovh.com/fr/hosting/modifier-lenvironnement-dexecution-de-mon-hebergement-web/#decouvrir-les-configurations-disponibles (sorry it's in French, but I think you can understand the chart)

So I tried various combinations, none of which seemed to do any good. :(

As for the erros logs, I only have some for two days since the migration, I'll attach the files too. As for yesterday's, it seems the only errors where caused when I tried to change to PHP 7 to see if PHP errors where shown on the pages. Well, the result is nothing worked at all!  ;D

But I also ran into something just now, when I tried to see the unread replies to my posts (https://www.neuronesconnection.fr/unreadreplies/). There's an error here:
QuoteMySQL server has gone away
Fichier: /home/mapyo/neuronesconnection/Sources/Recent.php
Ligne: 1084

Note : Il est possible que votre base de données nécessite une mise à jour. Actuellement, la version des fichiers du forum est SMF 2.0.15, alors que votre base de données est en version SMF 2.0.4. L'erreur signalée ci-dessus pourrait peut-être corrigée en exécutant la dernière version de upgrade.php.
The note says that my database may need to be upgraded, files version is 2.0.15 while database version is 2.04, the error might be fixed by running the latest version of upgrade.php

drewactual

#26
nah, that error is almost an error unto itself (the one about upgrading db's).. i don't think it has changed for 2.0+....

give me a bit to look at your uploads.



so.... if i'm looking at those logs along with that config file with straight eyes, your server is looking for php7 and not finding it, and falling back to fastcgi... then, in the error log and after deciding NOT to take into account fastcgi (as it is the fallback) errors, it looks for php7 in "/var/lib/fastcgi/php//images/squeeze.i386/7"

now look closely at that location address and tell me what's wrong with it?

rattle your hosts cage and tell them to repair their httpd file under their shared (virtualhost) settings to look for php in the right place.... it's usually in an apache directive... i can't imagine why it wouldn't be... and tell them to pay better attention to something so silly! 

also, just for the sake of senility, have them change the ini/httpd to look for headers in the right place, or tell it not to altogether.  it's a 'switch' iirc (an on/off, 1/0 setting).... IF headers are selected, there is a following directive to choose which type and flavor of headers to be sent.

hope this helps.

drewactual

just so you see the 'new' icon i'm posting this... response above in edited post

Sir Osis of Liver

The official mantra is there were no database changes in 2.0 branch, but iirc there was a minor change around 2.0.6, something to do with attachment mime types, but it wouldn't be causing the problems described here.  The database version error is usually bogus.

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

drewactual

And to spell "silly" out, as kindred has a valid point:  the notes in a virgin httpd file spells out "without the trailing slash" and the other for specific domain says "with leading slash" so folks don't mess this up. 

And the location itself is..... Different... But who knows about that. 

There is also a mod for apache that allows apache to find something even if the address is wrong so long as it's only slightly wrong... For instance, if someone had two slashes leading in a hard coded address php can ignore one of them and look for the file w/o it... If no file is found in the directory by that name it will look in the parent directory... It can, from there, be configured to look up, across, or down in other directories for files with similar names..... It will execute the file it thinks you are looking for.... This is a great thing in some cases, but really bad in others.

For some reason I'm thinking this mod likely exists on ypur server, and it has decided to look in the directory listed in the error... Why? Because I can't imagine a server being set up with php in that location.  It makes no sense, and it kinda flies in the face of "better practices"...

epikurieu

If I understand correctly (we really are reaching the limits of my knowledge here) you see a problem in the configuration of PHP7? Unfortunately I don't think we should focus on that, since I only enabled it for a few minutes and then turned it off. The actual PHP version is 5.4.
There are no other error logs, even though I know that there was some traffic on the forum.

Are the error log for 27/10 and the config file of any help?

drewactual

Will look at it again, but....

In the httpd file under virtual host there is a trailing slash telling apache where to find pip... It likely doesnt matter which php you choose that trailing slash will be there, and just as likely to be causing issues. 

epikurieu

OK :) I'm not really sur I can get the host to do anything about it, because half of the time you are in relation with sales people who know less than me about technical stuff, and the other half I'm afraid that I'll run into someone who won't bother to listen to what a simple client might have spotted... :-\

drewactual

the older error log chorus's "FastCGI failure fallback to CGI" which basically informs me that php IS NOT being implemented. 

I recall having issues with FastCGI and encountering this precise issue, and it boiled down to php not being implemented/started at all, but i don't recall what i did to recover it...

so..... if this were me, and it isn't, but if it were- i'd select FPM without FastCGI as a backup (which falls back to cgi and what is evidenced in your error log).  Then, I'd make certain the httpd is looking in the correct place, and the call DIDN'T have double slashes. 

the header issue stated in the log you provided (10/27) is a giveaway in-that "without header, how does the server know how to send or the browser how to display?"- in the httpd or .ini file there is a line addressing how, when, and what (if any) headers are provided.  the config, according to the error log, is obviously looking for headers and isn't finding them.


in short, your configuration is wrong- and is something you can't access most likely. 

if i were you i'd find another host.  setting up a server for php engined websites ought to be child's play for anyone in that industry, and they are falling on their faces it appears...... and, it won't matter if you load a new SMF or any other php operated engine, as it will fall on it's face too....

drewactual

do this:

make a new file, call it "info.php" and make this the contents of the file:
<?php
phpinfo
();
?>


then...navigate on your browser to that file, and tell us when it's live so we can see it.  I wager php is not initialized and if it is it is not configured properly.

epikurieu

https://www.neuronesconnection.fr/info.php

It seems that there's no double slash problem for version 5.4, is there?

I've been working with this host for years, we built a lot of PHP based websites (I work with a programmer, but he doesn't use frameworks or web-based software, that's why I don't ask him about this problem) and it always went OK, so I'm confused...

drewactual

5.4 looks to be okay- does it function as you expect?

5.4 is also not a part of apache4.x iirc- which means apache has been rebuilt on the server? <- scratch that, the build date says 24 Sept 2018 @ 07:57:52....

when you were attempting 5.6/7.0, how were you going about that?  this may explain why the config was looking in an image file for 7.0?

if 5.6/7.0 is available on the server, and it is a standard build Apache 2.4, the config file should be looking in the ...../usr/local/ea4/php5.6 (or a similar structure) directory akin to where it's finding 5.4 (which is /usr/local/php5.4/ect).... if you want 5.6+ (i think 2.0.15SMF will work on 5.4, just not recommended) the host simply needs to build and deploy apache2.4 and allow 5.6, 7.0,7.0x,and 7.1- and preferably in a pre-fork or FPM flavor.  those two seem to work the best for the nature of forums.  as a result of this build, they will need to change the httpd and have it pointed to the correct location of php (which it should fresh out of the box).

seeing that 5.4 is available and has been since September on this server tells me that MOST LIKELY 5.6 and 7.0 was NEVER TRULY available, as it creates a conflict.  It also offers some insight as to why it was looking for ea2.4 in an image directory... when i say image don't think picture, think more akin to clone.

drewactual

oh- and to the question about the earlier error log: FastCGI has to be told where to find php, it doesn't do it out of the box.  hence the FASTCgi error's resorting to CGI... and likely because php never even started to begin with.

also- i had trouble getting IonCube10 working with FPM and FastCGI.... IonCube5 worked, but the updated (10) would NOT play nice and crashed apache.  Once i removed it altogether (disabling it didn't work) upon Apache rebuild, all was well.... but this has nothing to do with your issue, but it will be good to know if you upgrade to ea4/php5.6+...


epikurieu

I didn't understand everything you said in the two last posts, but anyway I found the origin of the problem and corrected it. I'm embarrassed to say it, but it was a bad database export (or more likely, import) that caused all that... :-\

So thanks to all of you for your help. :)

Advertisement: