News:

Wondering if this will always be free?  See why free is better.

Main Menu

Database Error

Started by Ilkharnos, August 08, 2019, 05:39:39 AM

Previous topic - Next topic

Ilkharnos

Hello,

I am having a database error and I couldn't solve it so far. Here is how it happened:

I have just upgraded by web hosting service package by contacting my web hosting company. So they moved the contents of my smf forum to a new place. I didn't worry about this because I had already made backups for my public_html files and mysql database. I used Adminer for it.

After the contents were moved by the hosting company, I had to create a new database. I entered exactly the same database name, username and password when creating it. I even logged in to my database through Adminer and saw that all of the information was already there. However, when I checked my forum page, I kept getting "Database Error. Please try again later" message.

Even though the tables in my database were already intact, I tried deleting and importing them again from my backup in any case. It didn't solve my problem.

Then I downloaded settings.php through a FTP and I verified that all of the entries regarding database were correct.

Now, my forum page still shows Database Error message and I don't understand how I can solve it.

I would be grateful if you can assist. Thank you in advance.

Regards.     


Edit: My forum page URL is https://karamigfer.com

Arantor

So is there more detail in the error log table about what is actually wrong?

Ilkharnos

Unfortunately there isn't any detail. I translate the error message like this:

Database Error
Please try again after a while. If you see this error message again, contact the administrator.


In the meantime I tried to create an entirely new database, import my tables from my backup (with 0 errors) and alter Settings.php to include new username and database information. It didn't work.

Edit: Since I don't have access to anywhere in the forum, I cannot view the error log and investigate it further.

SpacePhoenix

What version of SMF are you running?

What mods are installed?

What version of MySQL server is being used?

What version of PHP is being used?

Ilkharnos

SMF version is 2.0.15.

I have many modifications which I have been installing manually for the last ten years. I cannot remember most of them. Enotify, footnotes, tooltip, default avatar, disable right click, password protect boards, sisyphus, simple portal, save as draft, favorites and custom pages are among them. I am sure that there are more.

MySQL version: 5.7.27

I use adminer.php 4.7.2, if that's what you mean.

Arantor

Quote from: Ilkharnos on August 08, 2019, 07:25:25 AM
Unfortunately there isn't any detail. I translate the error message like this:

Database Error
Please try again after a while. If you see this error message again, contact the administrator.


In the meantime I tried to create an entirely new database, import my tables from my backup (with 0 errors) and alter Settings.php to include new username and database information. It didn't work.

Edit: Since I don't have access to anywhere in the forum, I cannot view the error log and investigate it further.

Look in the database like I said, in smf_log_errors...

Ilkharnos

69   1565261754   0   93.89.225.254   ?https://karamigfer.com/   Database Error: Incorrect string value: '\xE1\xFE' for column 'ip' at row 1

70   1565261754   0   93.89.225.254   ?https://karamigfer.com/   2: array_unshift() expects parameter 1 to be array, null given

71   1565261755   0   93.89.225.254   ?action=enotify   Veritabanı Hatası: Incorrect string value: '\xE1\xFE' for column 'ip' at row 1

72   1565261755   0   93.89.225.254   ?action=enotify   2: array_unshift() expects parameter 1 to be array, null given



The rest is a loop of 71 & 72, with a couple of 69 & 70 inbetween.

Arantor

Your setup is putting invalid IPs into SMF somehow. Not sure how that's a thing.

Ilkharnos

69   1565261754   0   93.89.225.254   ?https://karamigfer.com/   Database Error: Incorrect string value: '\xE1\xFE' for column 'ip' at row 1

70   1565261754   0   93.89.225.254   ?https://karamigfer.com/   2: array_unshift() expects parameter 1 to be array, null given

71   1565261755   0   93.89.225.254   ?action=enotify   Database Error: Incorrect string value: '\xE1\xFE' for column 'ip' at row 1

72   1565261755   0   93.89.225.254   ?action=enotify   2: array_unshift() expects parameter 1 to be array, null given


69 & 71 are related to Subs-ForumFirewall.php
70 & 72 are related to Load.php




Edit: Is it possible that this problem is somehow related to UTF-8 coding format?

Arantor

Not really, it's literally not a valid IP address, even if it were UTF-8 valid.

Ilkharnos

Since yesterday, my web hosting service provider has been performing tests and trying to solve my problem. Here is what I can verify so far:

Php version: 5.4
MySQL version: 5.7.27
Database: Undamaged. Tested by me and the hosting company.
public_html files: Undamaged. I have backups for all of them.
Settings.php: all entries seems correct

However, when I view my forum page, I still get the same error, with the same error log entries.

69   1565261754   0   93.89.225.254   ?https://karamigfer.com/   Database Error: Incorrect string value: '\xE1\xFE' for column 'ip' at row 1

70   1565261754   0   93.89.225.254   ?https://karamigfer.com/   2: array_unshift() expects parameter 1 to be array, null given

71   1565261755   0   93.89.225.254   ?action=enotify   Database Error: Incorrect string value: '\xE1\xFE' for column 'ip' at row 1

72   1565261755   0   93.89.225.254   ?action=enotify   2: array_unshift() expects parameter 1 to be array, null given

69 & 71 are related to Subs-ForumFirewall.php
70 & 72 are related to Load.php



I can't use or access anything in my forum page. My service provider insists that the problem is somewhere within the software. All I can say that it was working perfectly fine before the server transfer performed by my provider. But it became broken just after the transfer. Even though I used my backups, it didn't work. Now my hosting service provider is unable to assist me and I started to feel helpless. I would be grateful for any kind of assistance from SMF team.

Regards.

Kindred

is your host (or you) using any sort of proxy (like cloudflare) or anything else?

your next option would be to load a clean set of files
(because it looks like the problem may lie with enotify - which is a mod, not part of SMF core)
Сл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."

Ilkharnos

Quote from: Kindred on August 09, 2019, 08:29:36 AM
is your host (or you) using any sort of proxy (like cloudflare) or anything else?

Not that I know of. But I will look into it.

I manually cleaned all enotify codes, all php files related to enotify and dropped enotify log tables from my database. I still get the error.

Now it looks like this:

?action=forum Database error: Incorrect string value: '\xE1\xFE' for column 'ip' at row 1
?action=forum 2: array_unshift() expects parameter 1 to be array, null given

shawnb61

Does anything look unusual in the contents of the various IP fields when viewed in phpmyadmin?   

Is it possible the host is sending ipv6? 
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Arantor

Quote from: shawnb61 on August 09, 2019, 11:19:14 AM
Does anything look unusual in the contents of the various IP fields when viewed in phpmyadmin?   

Is it possible the host is sending ipv6? 

Even if they were sending IPv6, the address should not contain the bytes it currently contains...

shawnb61

I think xE1FE are valid bytes within an ipv6 address?   And trying to stuff them into the 2.0.x string would cause issues? 

Either way, I would pursue every possible thread associated ips & with that host move... 
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Arantor

Nope. Addresses that come into PHP are strings, at least every time I've seen them. If those were valid bytes, I'd expect them to come in as strings in the sort of blah:e1fe:blah format. Not that 2.0 supports such things where they should already have been cut to empty strings by the stock query string code.

shawnb61

Makes sense.  I would still have the vendor look closely at ipv4 vs ipv6 configuration to be safe.  Something broke... 

Ilkharnos - do you have the 2.0 ipv6 mod installed?
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Ilkharnos

Quote from: shawnb61 on August 09, 2019, 01:11:46 PM
Makes sense.  I would still have the vendor look closely at ipv4 vs ipv6 configuration to be safe.  Something broke... 

Ilkharnos - do you have the 2.0 ipv6 mod installed?

No. I don't remember installing such mod.

I asked my host if they use CloudFlare or send ipv6. As a response they recommended to transfer my data again to the old server where everything was working fine. Their technical staff is a little weird, but I will give it a try. We will see what happens.

Ilkharnos

Yes, rolling back to the previous server solved this problem. My host's staff couldn't understand what exactly might have caused this error, but they now seem aware of what kind of server my page needs.

Arantor, Kindred and shawnb61: I am really grateful for your interest and assistance. Thank you guys.

Advertisement: