Registration not working

Solved Technical Support
  • Hi. I've finally completed the layout, design, etc for my site, and went to test registration, only to find it doesn't work. The only lines I see in the console are

    service-worker.js:14 Fetch finished loading: GET "https://sudonix.com/assets/src/modules/jquery-form.js?v=rk01e7gt748".
    (anonymous) @ service-worker.js:14
    Promise.then (async)
    (anonymous) @ service-worker.js:12
    DevTools failed to load source map: Could not load content for https://sudonix.com/assets/src/modules/pulling-drawer.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
    service-worker.js:14 Fetch finished loading: GET "https://sudonix.com/assets/src/modules/xregexp.js?v=rk01e7gt748".
    (anonymous) @ service-worker.js:14
    Promise.then (async)
    (anonymous) @ service-worker.js:12
    socket.io.js:3957 XHR finished loading: GET "https://sudonix.com/socket.io/?EIO=4&transport=polling&t=Nk7wBqz&sid=B6QHqZbWFH1ejnmdAAAK".
    e @ socket.io.js:3957
    n @ socket.io.js:3876
    e @ socket.io.js:3805
    e @ socket.io.js:3841
    e @ socket.io.js:4240
    e @ socket.io.js:4282
    i.emit @ socket.io.js:1915
    e @ socket.io.js:3994
    e @ socket.io.js:4053
    r.onreadystatechange @ socket.io.js:3945
    XMLHttpRequest.send (async)
    e @ socket.io.js:3957
    n @ socket.io.js:3876
    e @ socket.io.js:3805
    e @ socket.io.js:3841
    e @ socket.io.js:4240
    e @ socket.io.js:4282
    i.emit @ socket.io.js:1915
    e @ socket.io.js:3994
    e @ socket.io.js:4053
    r.onreadystatechange @ socket.io.js:3945
    XMLHttpRequest.send (async)
    e @ socket.io.js:3957
    n @ socket.io.js:3876
    e @ socket.io.js:3805
    e @ socket.io.js:3841
    e @ socket.io.js:4240
    e @ socket.io.js:4183
    e @ socket.io.js:3289
    e @ socket.io.js:2687
    n @ socket.io.js:2615
    e.exports @ socket.io.js:2453
    e @ socket.io.js:409
    n @ socket.io.js:322
    c @ socket.io.js:159
    (anonymous) @ sockets.js:17
    (anonymous) @ sockets.js:7
    DevTools failed to load source map: Could not load content for https://sudonix.com/assets/src/modules/jquery.form.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
    DevTools failed to load source map: Could not load content for https://sudonix.com/assets/src/modules/xregexp-all.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
    

    The page simply reloads, and nothing else happens. I originally had nodebb-plugin-spambegone installed, but removed this completely a rebuilt. Stll nothing.

    The files listed above as 404 also do not appear in the directory they are expected to be in, although these are just map files, so not overly concerned. However, I also see this

    jquery.js:10109 HEAD https://sudonix.com/api/v3/users/bySlug/test 404
    send @ jquery.js:10109
    ajax @ jquery.js:9690
    r @ api.js:16
    async function (async)
    r @ api.js:14
    (anonymous) @ api.js:42
    n @ api.js:41
    t.head @ api.js:53
    l @ register.js:127
    (anonymous) @ register.js:33
    dispatch @ jquery.js:5430
    m.handle @ jquery.js:5234
    jquery.js:10109 XHR failed loading: HEAD "https://sudonix.com/api/v3/users/bySlug/test".
    send @ jquery.js:10109
    ajax @ jquery.js:9690
    r @ api.js:16
    async function (async)
    r @ api.js:14
    (anonymous) @ api.js:42
    n @ api.js:41
    t.head @ api.js:53
    l @ register.js:127
    (anonymous) @ register.js:33
    dispatch @ jquery.js:5430
    m.handle @ jquery.js:5234
    service-worker.js:14 Fetch failed loading: HEAD "https://sudonix.com/api/v3/users/bySlug/test".
    (anonymous) @ service-worker.js:14
    Promise.then (async)
    (anonymous) @ service-worker.js:12
    jquery.js:10109 HEAD https://sudonix.com/api/v3/groups/test 404
    send @ jquery.js:10109
    ajax @ jquery.js:9690
    r @ api.js:16
    async function (async)
    r @ api.js:14
    (anonymous) @ api.js:42
    n @ api.js:41
    t.head @ api.js:53
    l @ register.js:128
    (anonymous) @ register.js:33
    dispatch @ jquery.js:5430
    m.handle @ jquery.js:5234
    service-worker.js:14 Fetch failed loading: HEAD "https://sudonix.com/api/v3/groups/test".
    (anonymous) @ service-worker.js:14
    Promise.then (async)
    (anonymous) @ service-worker.js:12
    jquery.js:10109 XHR failed loading: HEAD "https://sudonix.com/api/v3/groups/test".
    
  • @gotwf it seems to be working fine. I can see the cache building in nginx at least, and it's super fast.

  • Ok. I fixed this myself (I think - just checking out some other details). The problem seems to lie with the nginx.conf I have set. For example, this works fine

    server {
    	server_name sudonix.com www.sudonix.com;
    	listen x.x.x.x;
    	root /home/sudonix/public_html;
    	index index.php index.htm index.html;
    	access_log /var/log/virtualmin/sudonix.com_access_log;
    	error_log /var/log/virtualmin/sudonix.com_error_log;
    	fastcgi_param GATEWAY_INTERFACE CGI/1.1;
    	fastcgi_param SERVER_SOFTWARE nginx;
    	fastcgi_param QUERY_STRING $query_string;
    	fastcgi_param REQUEST_METHOD $request_method;
    	fastcgi_param CONTENT_TYPE $content_type;
    	fastcgi_param CONTENT_LENGTH $content_length;
    	fastcgi_param SCRIPT_FILENAME /home/sudonix/public_html$fastcgi_script_name;
    	fastcgi_param SCRIPT_NAME $fastcgi_script_name;
    	fastcgi_param REQUEST_URI $request_uri;
    	fastcgi_param DOCUMENT_URI $document_uri;
    	fastcgi_param DOCUMENT_ROOT /home/sudonix/public_html;
    	fastcgi_param SERVER_PROTOCOL $server_protocol;
    	fastcgi_param REMOTE_ADDR $remote_addr;
    	fastcgi_param REMOTE_PORT $remote_port;
    	fastcgi_param SERVER_ADDR $server_addr;
    	fastcgi_param SERVER_PORT $server_port;
    	fastcgi_param SERVER_NAME $server_name;
    	fastcgi_param PATH_INFO $fastcgi_path_info;
    	fastcgi_param HTTPS $https;
    	location ~ \.php(/|$) {
    		try_files $uri $fastcgi_script_name =404;
    		fastcgi_pass unix:/var/php-nginx/1629559163284729.sock/socket;
    	}
      location / {
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
            proxy_set_header Host $http_host;
            proxy_set_header X-NginX-Proxy true;
    
            proxy_pass http://127.0.0.1:4567;
            proxy_redirect off;
    
            # Socket.IO Support
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
        }
    	fastcgi_split_path_info ^(.+\.php)(/.+)$;
    	listen x.x.x.x:443 ssl http2;
    	ssl_certificate /home/sudonix/ssl.combined;
    	ssl_certificate_key /home/sudonix/ssl.key;
    	if ($scheme = http) {
    		rewrite ^/(?!.well-known)(.*) https://sudonix.com/$1 break;
    	}
    }
    

    However, this one (optimised for NGINX caching) doesn't

    server {
    	server_name sudonix.com www.sudonix.com;
    	listen x.x.x.x;
    	root /home/sudonix/public_html;
    	index index.php index.htm index.html;
    	access_log /var/log/virtualmin/sudonix.com_access_log;
    	error_log /var/log/virtualmin/sudonix.com_error_log;
    	fastcgi_param GATEWAY_INTERFACE CGI/1.1;
    	fastcgi_param SERVER_SOFTWARE nginx;
    	fastcgi_param QUERY_STRING $query_string;
    	fastcgi_param REQUEST_METHOD $request_method;
    	fastcgi_param CONTENT_TYPE $content_type;
    	fastcgi_param CONTENT_LENGTH $content_length;
    	fastcgi_param SCRIPT_FILENAME /home/sudonix/public_html$fastcgi_script_name;
    	fastcgi_param SCRIPT_NAME $fastcgi_script_name;
    	fastcgi_param REQUEST_URI $request_uri;
    	fastcgi_param DOCUMENT_URI $document_uri;
    	fastcgi_param DOCUMENT_ROOT /home/sudonix/public_html;
    	fastcgi_param SERVER_PROTOCOL $server_protocol;
    	fastcgi_param REMOTE_ADDR $remote_addr;
    	fastcgi_param REMOTE_PORT $remote_port;
    	fastcgi_param SERVER_ADDR $server_addr;
    	fastcgi_param SERVER_PORT $server_port;
    	fastcgi_param SERVER_NAME $server_name;
    	fastcgi_param PATH_INFO $fastcgi_path_info;
    	fastcgi_param HTTPS $https;
    	location ~ \.php(/|$) {
    		try_files $uri $fastcgi_script_name =404;
    		fastcgi_pass unix:/var/php-nginx/1629559163284729.sock/socket;
    	}
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_set_header X-NginX-Proxy true;
        proxy_redirect off;
    
        # Socket.io Support
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    
        gzip            on;
        gzip_min_length 1000;
        gzip_proxied    off;
        gzip_types      text/plain application/xml text/javascript application/javascript application/x-javascript text/css application/json;
    
        location @nodebb {
            proxy_pass http://127.0.0.1:4567;
        }
        location ~ ^/assets/(.*) {
            root /home/sudonix/nodebb/;
            try_files /build/public/$1 /public/$1 @nodebb;
            add_header Cache-Control "max-age=31536000";
        }
    
        location /plugins/ {
            root /home/sudonix/nodebb/build/public/;
            try_files $uri @nodebb;
            add_header Cache-Control "max-age=31536000";
        }
    
        location / {
            proxy_pass http://127.0.0.1:4567;
        }
    	fastcgi_split_path_info ^(.+\.php)(/.+)$;
    	listen x.x.x.x:443 ssl http2;
    	ssl_certificate /home/sudonix/ssl.combined;
    	ssl_certificate_key /home/sudonix/ssl.key;
    	if ($scheme = http) {
    		rewrite ^/(?!.well-known)(.*) https://sudonix.com/$1 break;
    	}
    }
    

    Not necessarily a show stopper for me, although it would be nice for NGINX to cache the assets and plugins, as per this.

    @julian @baris any ideas as to why this is ?

    Thanks

  • And now I get the below upon completing the registration

    6f1b3ce3-cbe0-4c91-b29c-a40155483917-image.png

    2021-08-27T14:42:01.646Z [4567/830199] - error: /register/complete/
    Error: [[error:invalid-data]]
        at Interstitials.email (/home/sudonix/nodebb/src/user/interstitials.js:14:9)
        at Object.wrapperCallback [as method] (/home/sudonix/nodebb/src/promisify.js:46:11)
        at fireMethod (/home/sudonix/nodebb/src/plugins/hooks.js:128:25)
        at Object.fireFilterHook [as filter] (/home/sudonix/nodebb/src/plugins/hooks.js:159:18)
        at Hooks.fire (/home/sudonix/nodebb/src/plugins/hooks.js:99:49)
        at Callbackified (node:util:303:5)
        at Object.wrapperCallback [as fire] (/home/sudonix/nodebb/src/promisify.js:44:12)
        at authenticationController.registerComplete (/home/sudonix/nodebb/src/controllers/authentication.js:143:16)
        at Layer.handle [as handle_request] (/home/sudonix/nodebb/node_modules/express/lib/router/layer.js:95:5)
        at next (/home/sudonix/nodebb/node_modules/express/lib/router/route.js:137:13)
    

    How do I fix this ?

  • Right - got this squared away.

    Despite saying it's "compatible" with 1.18.x, plugin nodebb-plugin-registration-notification doesn't seem to actually be. I've removed it, and now everything seems to work.

    It would be nice to get some clarity on this though.

  • @phenomlab Maybe RE: Cannot Login to nodebb: "Welcome back guest" is a solution to the issue you're experiencing.

  • @bejan Yep - that's it indeed (needs more testing, but initial looks great) 🙂 Thanks very much.

  • @phenomlab It would be nice indeed, to get some clarity w.r.t. caching. I can confirm that older versions work just dandy w/that nginx cache config. I don't have an 1.18 test bed to tweak on at the moment. Please do keep us in the loop(s) once you get it sussed out. Thx.

  • @gotwf it seems to be working fine. I can see the cache building in nginx at least, and it's super fast.

  • @phenomlab Good to know. Thx for the report. I need to get updated to the latest and greatest. One of these days... meanwhile... the ol' "if it ain't broke don't fix it" adage seems to be serving me reasonably well! 👍


Suggested Topics