Troubleshooting Forever and port 4567
-
Something new and maybe related. Never saw before.
make: Entering directory `forum/node_modules/hiredis/build' CC(target) Release/obj.target/hiredis/deps/hiredis/hiredis.o CC(target) Release/obj.target/hiredis/deps/hiredis/net.o CC(target) Release/obj.target/hiredis/deps/hiredis/sds.o CC(target) Release/obj.target/hiredis/deps/hiredis/async.o AR(target) Release/obj.target/deps/hiredis.a COPY Release/hiredis.a CXX(target) Release/obj.target/hiredis/src/hiredis.o make: g++: Command not found make: *** [Release/obj.target/hiredis/src/hiredis.o] Error 127 make: Leaving directory `forum/node_modules/hiredis/build' gyp ERR! build error gyp ERR! stack Error: `make` failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23) gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:797:12) gyp ERR! System Linux 3.11.0-12-generic gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd forum/node_modules/hiredis gyp ERR! node -v v0.10.26 gyp ERR! node-gyp -v v0.12.2 gyp ERR! not ok npm WARN optional dep failed, continuing [email protected] npm WARN package.json [email protected] No repository field. npm WARN package.json [email protected] No repository field. npm WARN package.json [email protected] No repository field. npm WARN package.json [email protected] No repository field.
Significant, right?
After installing g++ using
apt-get install g++
and re-running./nodebb upgrade
, that error was not repeated. -
No change. Something's very wrong.
info: NodeBB v0.3.2 Copyright (C) 2013 DesignCreatePlay Inc. info: This program comes with ABSOLUTELY NO WARRANTY. info: This is free software, and you are welcome to redistribute it under certain conditions. info: info: Time: Thu Mar 20 2014 15:00:00 GMT-0500 (CDT) info: Initializing NodeBB v0.3.2 info: * using configuration stored in: forum/config.json info: * using redis store at 127.0.0.1:6379 info: * using themes stored in: forum/node_modules info: [user.startJobs] Registering User Jobs warn: [plugins/nodebb-widget-essentials] staticDir is deprecated, use staticDirs instead warn: [plugins/nodebb-plugin-youtube] staticDir is deprecated, use staticDirs instead warn: [plugins/nodebb-plugin-sso-github] staticDir is deprecated, use staticDirs instead warn: [plugins/nodebb-plugin-sso-facebook] staticDir is deprecated, use staticDirs instead warn: [plugins/nodebb-plugin-linkcheck] staticDir is deprecated, use staticDirs instead warn: [plugins/nodebb-plugin-markdown] This plugin may not be compatible with your version of NodeBB. This may cause unintended behaviour or crashing. warn: [plugins/nodebb-plugin-vimeo] staticDir is deprecated, use staticDirs instead warn: [plugins/nodebb-plugin-dailymotion] staticDir is deprecated, use staticDirs instead warn: [plugins/nodebb-plugin-sso-google] staticDir is deprecated, use staticDirs instead warn: [plugins/nodebb-plugin-mentions] This plugin may not be compatible with your version of NodeBB. This may cause unintended behaviour or crashing. warn: [plugins/nodebb-plugin-sso-twitter] staticDir is deprecated, use staticDirs instead warn: [plugins/nodebb-plugin-sketchfab] staticDir is deprecated, use staticDirs instead warn: [plugins/nodebb-plugin-openid-steam] staticDir is deprecated, use staticDirs instead warn: [plugins/nodebb-plugin-42] staticDir is deprecated, use staticDirs instead warn: [plugins/nodebb-theme-lavender] staticDir is deprecated, use staticDirs instead warn: [plugins/nodebb-plugin-twitter] "callbacked" deprecated as of 0.4x. Use asynchronous method instead for hook: filter:scripts.get warn: [plugins/nodebb-plugin-emoji-extended] "callbacked" deprecated as of 0.4x. Use asynchronous method instead for hook: filter:scripts.get warn: [plugins/nodebb-plugin-linkcheck] "callbacked" deprecated as of 0.4x. Use asynchronous method instead for hook: filter:scripts.get warn: [plugins/nodebb-plugin-42] "callbacked" deprecated as of 0.4x. Use asynchronous method instead for hook: filter:scripts.get warn: [meta.scripts.get] Could not resolve mapped path: plugins/twitter/main.js. Are you sure it is defined by a plugin? warn: [meta.scripts.get] Could not resolve mapped path: plugins/emoji-extended-js/lib/jquery.textcomplete.min.js. Are you sure it is defined by a plugin? warn: [meta.scripts.get] Could not resolve mapped path: plugins/emoji-extended-js/emoji-textcomplete.js. Are you sure it is defined by a plugin? warn: [meta.scripts.get (nodebb-plugin-linkcheck)] filter:scripts.get is deprecated, consider using "scripts" in plugin.json warn: [meta.scripts.get (nodebb-plugin-42)] filter:scripts.get is deprecated, consider using "scripts" in plugin.json warn: [plugins] filter:server.create_routes is deprecated and will maintain limited functionality until 0.4x warn: [plugins/nodebb-plugin-sso-github] "callbacked" deprecated as of 0.4x. Use asynchronous method instead for hook: filter:auth.init warn: [plugins/nodebb-plugin-sso-facebook] "callbacked" deprecated as of 0.4x. Use asynchronous method instead for hook: filter:auth.init ReferenceError: meta is not defined at Object.Facebook.getStrategy (forum/node_modules/nodebb-plugin-sso-facebook/library.js:23:7) at forum/src/plugins.js:329:32 at forum/node_modules/async/lib/async.js:249:13 at iterate (forum/node_modules/async/lib/async.js:134:13) at forum/node_modules/async/lib/async.js:145:25 at forum/node_modules/async/lib/async.js:251:17 at forum/src/plugins.js:330:9 at forum/node_modules/async/lib/async.js:249:13 at iterate (forum/node_modules/async/lib/async.js:134:13) at Object.async.eachSeries (forum/node_modules/async/lib/async.js:150:9) info: [app] Restarting... info: [app] Shutdown (SIGTERM/SIGINT) Initialised. info: [app] Database connection closed. info: [app] Shutdown complete. info: NodeBB v0.3.2 Copyright (C) 2013 DesignCreatePlay Inc. info: This program comes with ABSOLUTELY NO WARRANTY. info: This is free software, and you are welcome to redistribute it under certain conditions. info: info: Time: Thu Mar 20 2014 15:00:01 GMT-0500 (CDT) info: Initializing NodeBB v0.3.2 info: * using configuration stored in: forum/config.json info: * using redis store at 127.0.0.1:6379 info: * using themes stored in: forum/node_modules
Just restarting non-stop. Had to kill it.
NodeBB itself is never started. That's why the port is not open and that's why I get the error message below when I attempt to access it:
[error] 9921#0: *148 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: site.com, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:4567/", host: "site.com"
It's like trying to connect to ssh on a server when the ssh serer is not running.
-
I think this explains why the local installation, which does not have any plugins installed other than the bundled Markdown plugin, is working fine, even though I'm using a version of Nginx that does not have good support for WebSockets.
Which brings up a point I've made earlier. With about 2 dozen plugins already available, it's going to be a nightmare if an outdated plugin will prevent NodeBB from starting. I made the mistake of upgrading what's supposed to be my production server to Edge, but I did it because I wanted to start accessing it from a subfolder.
I hope all the plugin will be compatible with 0.4.0 when it is released.
For the moment, I'm stuck. I can't start NodeBB. Now, can I downgrade to stable 0.3.2? At least with that, I can access it by appending the port to the URL.
-
Here's are a couple of suggestion:
-
Before a plugin is installed, have the script check that the plugin is compatible with the running instance of NodeBB. If not, abort the installation.
-
If
./nodebb upgrade
is run, first check that the installed plugins will be compatible with the new version. If not, abort the upgrade.
-
-
Finally. After 4 days of frustration, I can access my installation of NodeBB.
Here's the output from the startup log
info: NodeBB v0.3.2 Copyright (C) 2013 DesignCreatePlay Inc. info: This program comes with ABSOLUTELY NO WARRANTY. info: This is free software, and you are welcome to redistribute it under certain conditions. info: info: Time: Thu Mar 20 2014 17:37:00 GMT-0500 (CDT) info: Initializing NodeBB v0.3.2 info: * using configuration stored in: /forum/config.json info: * using redis store at 127.0.0.1:6379 info: * using themes stored in: /forum/node_modules info: [user.startJobs] Registering User Jobs warn: [plugins/nodebb-widget-essentials] staticDir is deprecated, use staticDirs instead warn: [plugins/nodebb-plugin-mentions] This plugin may not be compatible with your version of NodeBB. This may cause unintended behaviour or crashing. warn: [plugins/nodebb-plugin-markdown] This plugin may not be compatible with your version of NodeBB. This may cause unintended behaviour or crashing. warn: [plugins/nodebb-theme-lavender] staticDir is deprecated, use staticDirs instead warn: [plugins] filter:server.create_routes is deprecated and will maintain limited functionality until 0.4x warn: [plugins] filter:admin.create_routes is deprecated and will maintain limited functionality until 0.4x info: [themes] Compiling templates info: [themes] Successfully compiled templates. info: NodeBB attempting to listen on: 0.0.0.0:4567 info: NodeBB Ready
And port 4567 now shows up in the output of nmap and netstat.
How did I get to this point? Uninstalled most of the plugins.
Next step? See if I can access it from a subfolder via Nginx proxy
-
-
If they're existing images, I'm thinking they don't have the subfolder in the URL.
True, they don't, because before yesterday, I was accessing NodeBB by appending the port and subfolder like this: site.com:4567/forum. How do you suppose I can fix that now that I'm accessing it via site.com/forum.
I have a lot of images already.
-
The situation with images is this: existing images don't load and new images also don't load. If I attempt to insert an image, I get something like this:
![barts.gif](uploading100%)
. It never loads.Now, the path for existing images is something like this:
http://www.site.com/uploads/upload-67cc0ef9-0ea4-4d73-85ef-4521116b7cc5.png
. That's from the time I was accessing the site using its port number, before Nginx proxy came in to play.Now, the current image url is like this:
http://site.com/forum/topic/153/uploading100%
. The image never completely loads.Even after changing the upload_path from the default to "/forum/public/uploads", it still does not work
Do you have any ideas why and what can be used to solve this?
Something weird happens in the process uploading an image, as shown in this screenshot. It's visible for about 2 seconds before it reverts to normal.
-
@planner I have the same problem. When my home page is visited, nodebb send a [ "ws://..." 502 bad gateway ] on chrome console, and widgets are not loaded.
But after user click on any link, the error not occurring any more
I'm using nginx proxy bypass.
How you resolved this?Thanks
-
Because I have tons of images on the site that I could not use when accessing the site from a subfolder, I decided to run the site from a subdomain. So I abandoned the subfolder route.
-
@planner What is your config.json and ngix.conf?
Ps: I have used mydomain in this post instead of my real domain
my config.json:
{ "base_url": "http://www.mydomain.com", "port": "4567", "use_port": true, "secret": "-", "bind_address": "127.0.0.1", "database": "mongo", "mongo": { "host": "127.0.0.1", "port": "27017", "username": "-", "password": "-", "database": "-" }, "bcrypt_rounds": 12, "upload_path": "/public/uploads", "relative_path": "" }
And my nginx.conf
user www-data; worker_processes 4; pid /run/nginx.pid; events { worker_connections 768; # multi_accept on; } http { ## # Basic Settings ## sendfile off; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; # server_tokens off; # server_names_hash_bucket_size 64; # server_name_in_redirect off; include /etc/nginx/mime.types; default_type application/octet-stream; ## # Logging Settings ## access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; ## # Gzip Settings ## gzip on; gzip_disable "msie6"; # gzip_vary on; # gzip_proxied any; # gzip_comp_level 6; # gzip_buffers 16 8k; # gzip_http_version 1.1; # gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; ## # nginx-naxsi config ## # Uncomment it if you installed nginx-naxsi ## #include /etc/nginx/naxsi_core.rules; ## # nginx-passenger config ## # Uncomment it if you installed nginx-passenger ## #passenger_root /usr; #passenger_ruby /usr/bin/ruby; ## # Virtual Host Configs ## include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; server { listen 80; server_name www.mydomain.com; location / { 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_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"; # # Specific for comet or long running HTTP requests, don't buffer up the # response from origin servers but send them directly to the client. # #proxy_buffering off; # supposedly prevents 502 bad gateway error; # ultimately not necessary in my case proxy_buffers 8 32k; proxy_buffer_size 64k; tcp_nodelay on; } } }
When user access the website, chrome send this error:
WebSocket connection to 'ws://www.mydomain.com/socket.io/1/websocket/zDbVq799NSBdGgWrBH0o' failed: Unexpected response code: 502
-
If you set ***relative_path to /forum and proxy_pass to http://127.0.0.1:4567/forum, it should work, but likely with the problem I had uploading images.
And if that is the real secret in your config.json, you might want to remove it.