Getting Error: Unable to initialize Errsole on AWS EC2 instance #122
-
I am using AWS EC2 instances where Errsole is used in an nodejs environment. I keep getting the following error and also this message: Error: Unable to initialize Errsole It seem the pg package(used inside errsole to connect to postgresql) wish to connect to the localhost. I have set the options with the correct endpoint but still the error persist. Also I have successfully connected with errsole in my local computer. Note: I also installed heidisql (ui interface just like workbench) inside the WINDOWS AWS EC2 INSTANCE and it connect successfully. I did this to verify the aws security groups, ports.... Any ideas what can be going wrong... =============UPDATE================: Also I made a direct call to the db using the pg package directly and it worked perfectly! ======= UPDATE 2=====: ==== UPDATE 3=====:
B) building the project and running on pm2 cause the 127.0.0.1:5432 error. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Please check the errsole.initialize configurations
Make sure when you deploy your code in any remote server like AWS EC2, you should use proper configuration, not localhost . PS: For debugging purpose try to log the configuration details in terminal and make sure its proper.
|
Beta Was this translation helpful? Give feedback.
Hi thank for your reply, yes this was all working properly. For some reason when using pm2 errsole or pg was not reading my .env file properly. I had to create a ecosystem.config.js file and add the env path in there so errsole could consume properly..
PM2 ecosystem.config.js