MyBB Community Forums

Full Version: HTTP 500 error on registration
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
When i submit registration for a test account I am getting a HTTp 500 error. And it is not only me, i have a friend that is experiencing the same problem
I also checked error.log but didnt show nothing. Nothing.
Can someone help?

Also i have disabled all plugins but still the same.
Check your web server logs. If you're on shared hosting, you might need to contact your host to get access to them.
(2023-07-31, 02:40 AM)Laird Wrote: [ -> ]Check your web server logs. If you're on shared hosting, you might need to contact your host to get access to them.

u mean nginx? i did systemctl status but it did not say something interesting
[attachment=46194]

also here is my nginx configuration if there is sumting needed to be removed lmk
server {

  listen 80;
  listen 443 ssl http2;

  server_name shuriken.pm;

	ssl_certificate /root/.acme.sh/shuriken.pm/fullchain.cer;
	ssl_certificate_key /root/.acme.sh/shuriken.pm/shuriken.pm.key;

	gzip on;
	gzip_disable "msie6";
	gzip_vary on;
	gzip_proxied any;
	gzip_min_length 1024;
	gzip_comp_level 8;
	gzip_buffers 16 8k;
	gzip_http_version 1.1;
	gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;


  root /var/www/shuriken.pm;

  index index.php;
  location / {
    index index.php;
    autoindex off;

    rewrite ^/forum-([0-9]+)\.html$ /forumdisplay.php?fid=$1;
    rewrite ^/forum-([0-9]+)-page-([0-9]+)\.html$ /forumdisplay.php?fid=$1&page=$2;
    rewrite ^/thread-([0-9]+)\.html$ /showthread.php?tid=$1;
    rewrite ^/thread-([0-9]+)-page-([0-9]+)\.html$ /showthread.php?tid=$1&page=$2;
    rewrite ^/thread-([0-9]+)-lastpost\.html$ /showthread.php?tid=$1&action=lastpost;
    rewrite ^/thread-([0-9]+)-nextnewest\.html$ /showthread.php?tid=$1&action=nextnewest;
    rewrite ^/thread-([0-9]+)-nextoldest\.html$ /showthread.php?tid=$1&action=nextoldest;
    rewrite ^/thread-([0-9]+)-newpost\.html$ /showthread.php?tid=$1&action=newpost;
    rewrite ^/thread-([0-9]+)-post-([0-9]+)\.html$ /showthread.php?tid=$1&pid=$2;
    rewrite ^/post-([0-9]+)\.html$ /showthread.php?pid=$1;
    rewrite ^/announcement-([0-9]+)\.html$ /announcements.php?aid=$1;
    rewrite ^/user-([0-9]+)\.html$ /member.php?action=profile&uid=$1;
    rewrite ^/calendar-([0-9]+)\.html$ /calendar.php?calendar=$1;
    rewrite ^/calendar-([0-9]+)-year-([0-9]+)\.html$ /calendar.php?action=yearview&calendar=$1&year=$2;
    rewrite ^/calendar-([0-9]+)-year-([0-9]+)-month-([0-9]+)\.html$ /calendar.php?calendar=$1&year=$2&month=$3;
    rewrite ^/calendar-([0-9]+)-year-([0-9]+)-month-([0-9]+)-day-([0-9]+)\.html$ /calendar.php?action=dayview&calendar=$1&year=$2&month=$3&day=$4;
    rewrite ^/calendar-([0-9]+)-week-(n?[0-9]+)\.html$ /calendar.php?action=weekview&calendar=$1&week=$2;
    rewrite ^/event-([0-9]+)\.html$ /calendar.php?action=event&eid=$1;
  }

  # Deny access to internal files.
  location ~ /inc {
    deny all;
  }

  location ~ \.php$ {
	include snippets/fastcgi-php.conf;
    fastcgi_split_path_info ^(.+?\.php)(/.+)?$;
    fastcgi_pass unix:/run/php/php8.1-fpm.sock;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
fastcgi_buffering off;
  }

}
The nginx error log seems to generally be located at /var/log/nginx/error.log. See what you can find in there re this 500 error.
(2023-07-31, 08:17 AM)Laird Wrote: [ -> ]The nginx error log seems to generally be located at /var/log/nginx/error.log. See what you can find in there re this 500 error.

got this error after attempt to register, seems to be related to mysql
2023/07/31 08:47:53 [error] 143893#143893: *7 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught mysqli_sql_exception: Field 'default_tab' doesn't have a default value in /var/www/shuriken.pm/inc/db_mysqli.php:335
Stack trace:
#0 /var/www/shuriken.pm/inc/db_mysqli.php(335): mysqli_query()
#1 /var/www/shuriken.pm/inc/db_mysqli.php(378): DB_MySQLi->query()
#2 /var/www/shuriken.pm/inc/db_mysqli.php(842): DB_MySQLi->write_query()
#3 /var/www/shuriken.pm/inc/datahandlers/user.php(1232): DB_MySQLi->insert_query()
#4 /var/www/shuriken.pm/member.php(386): UserDataHandler->insert_user()
#5 {main}
  thrown in /var/www/shuriken.pm/inc/db_mysqli.php on line 335" while reading response header from upstream, client: 172.68.62.37, server: shuriken.pm, request: "POST /member.php HTTP/2.0", upstream: "fastcgi://unix:/run/php/php8.1-fpm.sock:", host: "shuriken.pm", referrer: "https://shuriken.pm/member.php"
It looks like you're using the MyTabs plugin, which adds a default_tab column to the mybb_users table, but doesn't set a default value for that column.

Try running this query on your database, which will alter that added column to set a default value of the empty string:

ALTER TABLE mybb_users CHANGE default_tab default_tab TEXT NOT NULL DEFAULT '';
(2023-07-31, 08:58 AM)Laird Wrote: [ -> ]
ALTER TABLE mybb_users CHANGE default_tab default_tab TEXT NOT NULL DEFAULT '';
I did the command on dbeaver, after i tried registration i still got http500 error with the same kind of error on error.log.
did the same command for newpoints_items and ougc_awards and it worked!

a friend is having problems doing this
while he attempts to do the query he gets this error
[Image: image.png]
Oh, right, I forgot - in strict mode, MySQL doesn't allow default values for TEXT columns. Try instead (for your friend and even for your own installation) to make the column nullable rather than having an empty-string default:

ALTER TABLE mybb_users CHANGE default_tab default_tab TEXT NULL;

Hopefully, that doesn't introduce any subtle errors due to queries not returning NULL columns.
he did that but still doesnot work
he sent me this log
Stack trace:
#0 /var/www/html/inc/db_mysqli.php(335): mysqli_query()
#1 /var/www/html/inc/db_mysqli.php(378): DB_MySQLi->query()
#2 /var/www/html/inc/db_mysqli.php(842): DB_MySQLi->write_query()
#3 /var/www/html/inc/datahandlers/user.php(1232): DB_MySQLi->insert_query()
#4 /var/www/html/member.php(386): UserDataHandler->insert_user()
#5 {main}
  thrown in /var/www/html/inc/db_mysqli.php on line 335" while reading response header from upstream, client: [ REDACTED ], server: _, request: "POST /member.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php8.1-fpm.sock:", host: "raiding.to", referrer: "https://raiding.to/member.php"
What's above "Stack trace:"? There should be an error message with details of the actual error.
Pages: 1 2