How do I add information to my Heroku database? - javascript

I am currently trying to deploy a Node.js application to Heroku. The website is working until I try and login or do other operations that call the database. I have the database attached and keep getting the Error: write EPIPE error. From what I can tell from my research, it seems like I need a worker process. Right now I have my web process as ./bin/www and I do not know what to set my worker process to. I tried setting it to the same thing, but the app crashes. How do I add information from my app to a Heroku database?

Related

mongodb npm preventing application to run on www, yet runs on localhost

I have this node.js accounts app that I'm trying to implement a mongoDB database onto, but it seems to have errors when I upload it to cpanel. My mongoDB url is in this format: mongodb+srv://:#. After some experimenting, turning the Node.js version to ^14 caused errors to stop, but the app still wouldn't run (going to the url reslted in a 503 error, this is the current state of the server).
github: https://github.com/codingtuba/accounts.aimedtuba/tree/mongodb
before mongo DB: https://github.com/codingtuba/accounts.aimedtuba

Google Cloud Storage - "Error: Could not load the default credentials"

While developing my app in Node.js, I decided to persist my data by using the Google Cloud Storage client libraries.
I came across the error mentioned in the title when uploading to storage:
Error: Could not load the default credentials
I did some digging, and figured out how to solve the issue:
Navigating to google cloud console credentials and creating a service account.
Setting the role for the service account to have full object permissions across my project and my buckets
Creating a key for the service account and downloading the associated .json file
Installing Cloud SDK and running the commands:
gcloud auth application-default login
gcloud config set project [MY_PROJECT_ID]
gcloud auth activate-service-account --key-file=C:/path/to/json/file
In my code passing in the .json credentials file into my new client instance:
const storage = new Storage({keyFileName: "auth.json"})
These steps described fixed the issue... in development. When I deployed my app to production the same error message comes back
I tried a few things to solve the issue. I assumed it was an issue with my web host: A2. After talking with their tech support they reassured me my file paths are correct inside their file structure, but they would not help me troubleshoot the credentials error otherwise.
So, why would my credentials be working just fine in development, but then suddenly stop working in production? Is it because I had the localhost as the callback URI instead of the domain name (or something)? Do I need to specify the domain somewhere in SDK or in the cloud console?
The error message points me to https://cloud.google.com/docs/authentication/getting-started, but I have read and reread the documentation many times, so if someone can point me to the specific place in the docs that says what I need to do that would be appreciated, but be aware that I have done my homework and I RTFM, but I am still unable to solve this issue.

getting javax.mail.AuthenticationFailedException on heroku

I am Using Heroku to deploy my java spring boot backend which utilizes the javamailsender. When testing locally before deployment, I was able to send emails and receive emails thru the application. But, ever since I deployed it on heroku, I have been receiving error whenever I try to send email.
Error Sending Email: Authentication failed; nested exception is javax.mail.AuthenticationFailedException: 534-5.7.9 Application-specific password required. Learn more at
2020-07-17T01:00:29.110458+00:00 app[web.1]: 534 5.7.9 https://support.google.com/mail/?p=InvalidSecondFactor r188sm8440648qkf.128 - gsmtp
2020-07-17T01:00:29.110462+00:00 app[web.1]:
I have seen plenty of articles/discussion forum where users encounter such problem and I tried to resolve using the solution that was given but was unsuccessful. I have the 2-Step-Verification on and turned on the less secure app but no luck. I also saw that doing App Password helped solved the issue but didn't really understand how to go about that in terms of my app on heroku. I have react frontend hosted on firebase and spring boot backend hosted on heroku. Any help would be appreciated. Thank you!
Nvm, I figured out what was causing this error. I guess I had to create an App Password and use that password that was created inside my application.properties.

Npm crashing error when trying to deploy build

I am working on a Discord Bot and trying to host it off of Heroku. I ran into this particular error while going through this process and I am unsure how to proceed.
I am unsure what to try here or what these errors mean. This shows up in the Heroku logs for my app.
I am just trying to use Heroku to host my bot but this am running into this issue while attempting to do this.

Heroku Logs Not Loading

In my Heroku dashboard or on my command, when I try to open my logs i get a 503 Service Unavailable and I can't file a support ticket because I am using a free account. Does anyone know why this would be happening? The Heroku status monitor also says that Heroku services are all good https://status.heroku.com/. My app is also currently running and it does not seem to be affected. I am pretty sure this is an issue with Heroku but I can't get any support due to being a free account.

Categories

Resources