Wrong value type sent to the database. IPv4 or IPv6 expected.(ip)

Started by klondike, Yesterday at 11:50:36 AM

« previous - next »

klondike

Wrong value type sent to the database. IPv4 or IPv6 expected.(ip)

I just started getting the error above and it wouldn't clear. Will see if I can find what it means.

Anway...

Tried on my phone - no problem
Tried using a different browser - no problem.
Cleared browser cache - fixed the problem.

If you see this remember the solution to try.


===

Seems it was probably a glitch. Somehow my IP was not being passed and the code can't handle nulls. There are very old reports all of which were fixed.


                  Checkout your Wordle stats

klondike

OK this turned out to be a hard error.

This site runs under Apache which is a webserver that serves all the pages to your browsers.

I have found the root cause of the problem and disabled the Apache feature that was leading to it. This was based on a guess as I have other websites running this Apache feature and they are all fine.

The site (like a good chunk of the internet) sits behind Cloudflare proxy servers which do a lot of the heavy lifting in keeping malicious bots out and speeding sites up which is a good thing. The downside is that sites sitting behind such proxy servers do not "see" the real IP address of the remote user. The forum code keeps track of IPs using the site to maintain user bans and detect known spammers. There is a feature that can be added to the webserver that tells it to provide the real remote IP for a list of proxy IP addresses and that has been in use since I set the site up. It seems that something has changed or gone astray and sometimes  an invalid IP (probably something called a NULL which means undefined) is being returned which causes the error in the forum code. My guess is Cloudflare changed something.

I'm not not going to bust a gut looking for the real problem as the workaround seems to have stopped it preventing the site from working. I'll do searches periodically to see if there is a proper fix. It has also occurred to me that I might ask AI

This is the Cloudflare explanation
https://developers.cloudflare.com/support/troubleshooting/restoring-visitor-ips/restoring-original-visitor-ips/
It probably won't make any more sense than my abbreviated version.



                  Checkout your Wordle stats

Ruthio

I don't begin to understand  any of this, but it seems ok now! 👍 

Mups

Quote from: Ruthio on Yesterday at 09:44:23 PMI don't begin to understand  any of this, but it seems ok now! 👍
Me neither, Ruthio,  may as well be Chinese.  
Glad K was able to fix it though ey.

CHF