Pm2 and nginx not communicating failed (SSL: error:0A000126:SSL routines::unexpected eof while reading) - amazon-web-services

Hello I am experiecing the error code Failed to load resource: net::ERR_CONNECTION_REFUSED and have found the error code below in nginx error.log. I am using pm2 and nginx. I have tried to restart both pm2 and nginx but it didnt fix anything. Pm2 status is telling me everything is working fine and pm2 logs are saying the server is running. So my best guess is going of the code below. How do I fix it?
2022/05/18 13:19:26 [crit] 19004#19004: *1003 SSL_read() failed (SSL: error:0A000126:SSL routines::unexpected eof while reading) while keepalive, client: x.x.x.x, server: 0.0.0.0:443
I also get this error code now from pm2 logs:
Error: listen EADDRINUSE: address already in use :::3005
at Server.setupListenHandle [as _listen2] (node:net:1372:16)
at listenInCluster (node:net:1420:12)
at Server.listen (node:net:1508:7)
at Function.listen (/home/ubuntu/apps/bachelor-app/Server/node_modules/express/lib/application.js:618:24)
at Object.<anonymous> (/home/ubuntu/apps/bachelor-app/Server/Server.js:239:5)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Object.<anonymous> (/usr/lib/node_modules/pm2/lib/ProcessContainerFork.js:33:23) {
code: 'EADDRINUSE',
errno: -98,
syscall: 'listen',
address: '::',
port: 3005
}
I can however only see one of them running with pm2 status

Related

Kubernetes param store issue

I get an error related to aws paramstore in kubernetes container.
[1/4] Resolving packages...
success Already up-to-date.
Done in 1.00s.
yarn run v1.22.5
$ db-migrate --config ./src/db/config.js --migrations-dir ./src/db/migrations -e config up
[ERROR] Error: getaddrinfo EAI_AGAIN ssm.eu-west-1.amazonaws.com
at ParameterQuery.executeSync (/backend/node_modules/aws-param-store/lib/param_query.js:99:19)
at getParametersSync (/backend/node_modules/aws-param-store/lib/index.js:49:10)
at /backend/config/__helpers/awsParams.js:23:34
at Array.reduce (<anonymous>)
at retrieveAWSParams (/backend/config/__helpers/awsParams.js:22:28)
at getAwsParams (/backend/config/__helpers/awsParams.js:61:22)
at Object.<anonymous> (/backend/config/index.js:21:13)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.

apache2 libapache2-mod-wsgi-py3 django

Previously my code was working with apache2, django and libapache2-mod-wsgi. But I had to use python3, hence I removed libapache2-mod-wsgi and installed libapache2-mod-wsgi-py3. Now I am getting an error when I restart apache2.
Below is the error from command systemctl status apache2.service. I don't know why WSGIScriptAlias is not working for libapache2-mod-wsgi-py3.
The apache2 configtest failed.
Output of config test was:
AH00526: Syntax error on line 7 of /etc/apache2/sites-enabled/000-default.conf:
Invalid command 'WSGIScriptAlias', perhaps misspelled or defined by a module not
Action 'configtest' failed.
The Apache error log may have more information.
apache2.service: Control process exited, code=exited status=1
Failed to start LSB: Apache2 web server.
apache2.service: Unit entered failed state.
apache2.service: Failed with result 'exit-code'.

nginx permission denied while attempting to connect to upstream Ubuntu 14.04 Gunicorn

Ok. I'm at the end of my rope here. I had this working, then I'm not sure if it was just coincidence but I set up VNC on the server and it stopped working (followed this tutorial: https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-vnc-on-ubuntu-14-04)
I've got a Django project through Digital Ocean. I followed their tutorial found here: https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-14-04
sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
cat /var/log/nginx/error.log
015/05/04 22:03:33 [crit] 6399#0: *3 connect() to unix:/path/to/project.sock failed (13: Permission denied) while connecting to upstream, client: ipaddress, server: myproject.com, request: "GET / HTTP/1.1", upstream: "http://unix:/path/to/project.sock:/", host: "myproject.com"
ls -lh ~/myproject
srwxrwxrwx 1 myusername www-data 0 Apr 1 12:37 myproject.sock
I've been scouring all over but I can't find anything that quite matches what my problem seems to be, even though I have a feeling it's just a silly permission thing that got changed somehow.
If there's anything not clear enough above please ask me to elaborate.
I think you made mistake with sock file in your nginx conf file:
proxy_pass http://unix:/home/user/myproject/myproject.sock;
As showed in error log nginx tries to open /path/to/project.sock file. Change it to /home/username/myproject/myproject.sock

Where is the uWSGI (error) log file when installing uWSGI using pip?

I'm trying to run my Django app using Nginx and uWSGI. When I try to go to
127.0.0.1:8001/media/media.png
Nginx properly shows the image, but when I go to
127.0.0.1:8000/CMS/users
Django is supposed to call a view. Instead, Nginx returns a 504 Gateway Time-out. When I view the Nginx error log, it says
*6 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 127.0.0.1, server: 192.168.174.131, request: "GET /CMS/users HTTP/1.1", upstream: "uwsgi://127.0.0.1:8001", host: "127.0.0.1:8000"
Does a uWSGI error log file exist? If yes, where can I find it? (I'm searching for it because I think it might help debug the issue).
Note: I installed uwsgi using pip.

yeoman generator-ember doesn't show anything in browser

Following this https://github.com/yeoman/generator-ember tutorial to use EmberJS with Yeomane, after running grunt server the browser is blank.
I expected to see this page but nothing shows up:![enter image description here][1]
UPDATE:
console error:
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/styles/style.css
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/bower_components/jquery/jquery.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/bower_components/handlebars/handlebars.runtime.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/bower_components/ember/ember.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/bower_components/ember-data-shim/ember-data.js
Uncaught ReferenceError: Ember is not defined compiled-templates.js:1
Uncaught ReferenceError: Ember is not defined combined-scripts.js:3
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/bower_components/bootstrap-sass/js/affix.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/bower_components/bootstrap-sass/js/alert.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/bower_components/bootstrap-sass/js/dropdown.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/bower_components/bootstrap-sass/js/tooltip.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/bower_components/bootstrap-sass/js/modal.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/bower_components/bootstrap-sass/js/transition.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/bower_components/bootstrap-sass/js/button.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/bower_components/bootstrap-sass/js/popover.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/bower_components/bootstrap-sass/js/carousel.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/bower_components/bootstrap-sass/js/scrollspy.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/bower_components/bootstrap-sass/js/collapse.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/bower_components/bootstrap-sass/js/tab.js
Update 2:
works-Mac:myemberapp1 work$ grunt server
Running "server" task
Running "clean:server" (clean) task
Running "replace:app" (replace) task
Replace app/index.html -> .tmp/index.html
Running "concurrent:server" (concurrent) task
Running "emberTemplates:dist" (emberTemplates) task
File ".tmp/scripts/compiled-templates.js" created.
Done, without errors.
Running "compass:server" (compass) task
Done, without errors.
Running "neuter:app" (neuter) task
Running "connect:livereload" (connect) task
Started connect web server on localhost:9000.
Running "open:server" (open) task
Running "watch" task
Waiting...
For the specific error Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/styles/style.css, you should also check that you have got the compass server installed. That is:
gem install compass
To check that compass is running correctly, run grunt serve --verbose and check the output for any errors, such as:
in `to_specs': Could not find compass (>= 0) amongst [...] (Gem::LoadError)
After the scaffolding is complete, you must run the commands bower install and npm install to install the required packages (described in the bower.json and package.json files. After this, grunt will be able to serve up the dependencies.
As you build up your project and use introduce new dependencies, you'll add them by editing your bower.json and/or package.json files and rerunning the installs. Downloaded packages are usually not stored in source control.