News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Database Error when connecting with IPv6

Started by Holt31, July 23, 2017, 01:42:22 PM

Previous topic - Next topic

Holt31

Hello guys,
if I try to use SMF 2.0.1.4 with Nginx (nginx/1.10.3) and php7.0-fpm I get a strange error when connecting with IPv6 to the forum site.
I'm using Mysql (5.7.18-0ubuntu0.17.04.1) on a dedicated server from Hetzner. I'm using Ubuntu 17.04 as server os.
So the problem is when someone joins with the domain (nox-gaming.de) on that forum they are getting Database Errors on every site.
I tryed it with a brand new installation of smf 2.0.1.4 with no mods installed to make sure that no mod is providing the database error.
So this is my Nginx config for the server:


server {
listen 80 default_server;
#listen [::]:80 default_server;
server_name nox-gaming.de www.nox-gaming.de;
return 301 https://$server_name$request_uri;
}

# SSL
server {
    listen 443 ssl http2;
    #listen [::]:443 ssl http2;

    root /***/***/***;
    index index.php index.html index.htm index.nginx-debian.html;

    server_name nox-gaming.de www.nox-gaming.de;

ssl_certificate /***/***/***/***.cer;
ssl_certificate_key /***/***/***/***.key;
   
location / {
try_files $uri $uri/ /index.php?$args;
}

# PHP-7
location ~ \.php$ {
#If a file isn't found, 404
try_files $uri =404;
#Include Nginx's fastcgi configuration
include /etc/nginx/fastcgi.conf;
#Look for the FastCGI Process Manager at this location
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}

# Phpmyadmin Configurations
location /***/***/***/phpmyadmin {
   root /usr/share/;
   index index.php index.html index.htm;
   location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
   root /usr/share/;
   }
   }
# URL Rewrite for Nginx PHPMyAdmin
   
   location /phpMyAdmin {
   rewrite ^/* /phpmyadmin last;
   }

# URL Rewrite for SMF
location /forum {
   if (!-e $request_filename) {
                # Rules for: profiles
                rewrite ^/forum/profile/([^/]+)/?$ "/forum/index.php?pretty;action=profile;user=$1" last;

                # Rules for: actions
                 rewrite ^/forum/(activate|admin|ads|announce|attachapprove|ban|boardrecount|buddy|calendar|clock)/?$ "/forum/index.php?pretty;action=$1" last;
                 rewrite ^/forum/(collapse|convertentities|coppa|credits|deletemsg|detailedversion|display|dlattach|editpoll|editpoll2)/?$ "/forum/index.php?pretty;action=$1" last;
                 rewrite ^/forum/(emailuser|featuresettings|findmember|groups|help|helpadmin|im|jseditor|jsmodify)/?$ "/forum/index.php?pretty;action=$1" last;
                 rewrite ^/forum/(jsoption|lock|lockvoting|login|login2|logout|manageboards|managecalendar|managesearch|manageattachments|maintain|markasread|mascot)/?$ "/forum/index.php?pretty;action=$1" last;
                 rewrite ^/forum/(membergroups|mergetopics|mlist|moderate|modifycat|modifykarma|movetopic|movetopic2|news|notify)/?$ "/forum/index.php?pretty;action=$1" last;
                 rewrite ^/forum/(notifyboard|optimizetables|openidreturn|packages|permissions|pm|post|postsettings|post2|printpage|profile|quotefast)/?$ "/forum/index.php?pretty;action=$1" last;
                 rewrite ^/forum/(quickmod|quickmod2|recent|regcenter|register|register2|reminder|removepoll|removetopic2)/?$ "/forum/index.php?pretty;action=$1" last;
                 rewrite ^/forum/(repairboards|reporttm|requestmembers|restoretopic|reports|search|search2|sendtopic|serversettings|smileys|smstats|suggest)/?$ "/forum/index.php?pretty;action=$1" last;
                 rewrite ^/forum/(spellcheck|splittopics|stats|sticky|theme|trackip|about:mozilla|about:unknown)/?$ "/forum/index.php?pretty;action=$1" last;
                 rewrite ^/forum/(unread|unreadreplies|verificationcode|viewErrorLog|viewmembers|viewprofile|vote|viewquery|viewsmfile|who)/?$ "/forum/index.php?pretty;action=$1" last;
                 rewrite ^/forum/(\.xml|xmlhttp)/?$ "/forum/index.php?pretty;action=$1" last;

                # Rules for: boards
                 rewrite ^/forum/([-_!~*'()$a-zA-Z0-9]+)/?$ "/forum/index.php?pretty;board=$1.0" last;
                 rewrite ^/forum/([-_!~*'()$a-zA-Z0-9]+)/([0-9]*)/?$ "/forum/index.php?pretty;board=$1.$2" last;

                # Rules for: topics
                 rewrite ^/forum/([-_!~*'()$a-zA-Z0-9]+)/([-_!~*'()$a-zA-Z0-9]+)/?$ "/forum/index.php?pretty;board=$1;topic=$2.0" last;
                 rewrite ^/forum/([-_!~*'()$a-zA-Z0-9]+)/([-_!~*'()$a-zA-Z0-9]+)/([0-9]*|msg[0-9]*|new)/?$ "/forum/index.php?pretty;board=$1;topic=$2.$3" last;

                 rewrite ^/(.*)$ /index.php?params=$1 last;
}
   }
location ~ /\.ht {
        deny all;
    }
}


Even if I deactivate those rewrite rules, I have the same problem.
So if I deactive IPv6 in Nginx all is working fine.
But then the next problem happened: Some Firefox users can't join the site (also the normal website before smf).
I found out that they all are trying to join with IPv6.
I have an AAAA-Record on my Domain and also an A-Record. (I need it for mailserver)
Both IP-Addresses on the Domain are correctly entered.
My Mysql is running on localhost with IPv4.
Databasesettings are:
Host: localhost
Port: Standard
User: ***
PW: ***
No Nginx-Errorlogs where found.
No SMF-Errorlogs also.
Is it possible to let Nginx running with IPv6 without any Database-Error-Messages and a working page?
Because these users can join the site if I active IPv6. But than the forum isn't working anymore.
I put so much work into my SMF-Configuration. I don't won't to migrate my installed forum to another forum-system.
For me SMF is the best forum system out there. So I don't want to change.
The forum is reachable on hxxp:nox-gaming.de/forum [nonactive]

vbgamer45

Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Holt31

Just the message:
Database error: Try again or try to contact an administrator.
No errors in Admin-Panel and no errors in nginx and mysql-logs.

vbgamer45

Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Holt31

Yeah I have that mod installed.
The Problem is my Theme is not working anymore with SMF-2.1 also all mods I installed would be useless.
I know that SMF 2.0 is not supporting IPv6 but it is strange that you get a database error when connecting with IPv6 to the forum-site.

Holt31

Ok a friend of mine tryed now with ipv6 again and now I get an error:
Databaseerror: Data too long for column 'session' at row 1
I will search the forum now for fixing this problem.

vbgamer45

You can disable database driven settings under server settings
Or you can increase the session column size in the database for the smf_sessions table.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Holt31

I increased the session column size before you told me. But thanks  :laugh:
So new problem is: Databaseerror: Incorrect string value: ''Someones IPv6-Addres here'' for function inet_aton
I can't find any usefull answer in forum.

vbgamer45

Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Holt31


vbgamer45

Does say a line or file number?

Also maybe turn off database driven sessions under server settings as well
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Holt31

I turned of database driven sessions already, but same problem.
I just get still this error. It's just that. I found out that inet_aton is a function in /Sources/Subs.php
But no line error and no file number as well.
It's creepy that we can't figure out why it's not working.

vivien

I have the same problem since switching to PHP 7 (SMF 2.0.15 with mod "IPv6 Support 1..1" installed)

GigaWatt

"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?"..."

vivien

SMF: 2.0.15
IPv6 Support: 1.0.1
PHP Version : PHP 7.0.28-0ubuntu0.16.04.1
MySQL : MySQL: 5.7.21-0ubuntu0.16.04.1
Apache : Apache/2.4.18 (Ubuntu) Server built: 2017-09-18T15:09:02
OS : Ubuntu server 16.04 LTS 64bits

With IPv6 :
Incorrect string value: ''2a01:cb08:768:xx00:600b:1bbd:5541:6de0'' for function inet_aton
Fichier: /forum/Sources/Subs.php
Ligne: 2675


All is ok with IPv4

vbgamer45

SMF 2.0.x doesn't support IPv6 disable apache from listen on ipv6.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro


vbgamer45

I would leave comments in that mods topic. They might not have fixed all cases like in your case.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Advertisement: