Cannot get initialAdminPassword for jenkins on heroku - bash

I am trying to get started with jenkins on heroku but I came across a problem is that now after deloying jenkins to heroku it wants to get the administrator password, and shows me this path /app/.jenkins/secrets/initialAdminPassword
I ssh'd into my heroku app and tried cat ( path ) but it shows there is no path like that on my heroku bash.
To set up my heroku server I followed this https://gist.github.com/jordansissel/2313443
I attached a picture of me trying in different ways

You can log out and then writeheroku logs --app yourappname
The password can be found there on the logs. If you cant see it, then restart the dynos.

Related

Inspect Heroku local logs

I have an app that's deployed to production, but I'm also testing it locally.
When I run heroku logs --tail, I get the production logs. I can see when I make a request to the webapp and it shows up instantly in the logs.
However, my app on heroku local returns me a "500 Server Error." I want to inspect these logs to understand why. However, I can't find these logs. Is there a command like heroku local logs --tail?
In order to see logs in IDE or Console use below command
Local:
I'm using Python script and the same deployed in heroku. I want to run locally by using heroku local command and would like to see logs in console but it is not showing logs in IDE Console. So for workaround i tried below command and it works well. Now I can see logs in the IDE itself.
E.g. for Python Script:
heroku local:run python test.py
E.g. for Rails:
heroku local:run rails console
Production:
heroku logs --tail --app <app-name>

"Couldn't find that app." when running heroku commands in console

I'm trying to run commands for my heroku app in my console, but it keeps telling me "Couldn't find that app." even though when I run heroku apps in my console it tells me I have one app called worldofwarcraft-api
So heroku recognizes my app in the apps list, but I can't run any commands to access it. The line I want to run is
heroku ps:scale web=1 --app worldofwarcraft-api
I'm trying to troubleshoot why my API returns a 503 when I try to make a GET request to it. This is the fix the heroku faq told me to try, but it's just telling me it can't find my app.
I'm wondering if it has something to do with the fact that I deployed my API from github, rather than running the heroku setup in my console. I don't know if that would effect my ability to run heroku commands on the app in my local console.
Apologies if my formatting is off a bit. I'm still getting used to this site.
In my case, someone renamed GitHub repo and I tried to find Heroku app with new GitHub name
It helps me
heroku apps
heroku git:remote -a YOUR_APP
Solved it. Just sharing for future searches.
The issue was fixed by running git init and then heroku git:remote -a worldofwarcraft-api in my command line while inside my repositories folder. This initialized git in the repo and then set the heroku git remote to that repository.
Hopefully, this helps anyone else who had a similar issue.
Just an easy way to solve this issue:
1st: Add the command into your terminal: $ heroku apps
If you already logged into your heroku account from your terminal, all your apps will appear as a list like this:
your-project-name-1
your-project-name-2
your-project-name-3
your-project-name-4
2nd: Then chose which one you are needing to connect with the following command:
$ heroku git:remote -a your-project-name-2
If you've done the connection properly you'll receive the following output:
set git remote heroku to https://git.heroku.com/your-project-name-2.git
For my case, I was renaming my github repository.
You can find it in your repository settings then just rename it, it appears in the first place.
Then you can continue with git init again to re-initiate your existing git repository and then set your heroku remote with your heroku apps new name heroku git:remote -a YOUR_APP_NAME
If the app belongs to a team that you participate in, you have to specify the team option in the commands to see the app:
E.g:
heroku apps -t <team name>
or
heroku ps:scale web=1 --app worldofwarcraft-api -t <team name>

How to debug an Heroku app, since logs don't help att all?

I'm trying to deploy a nodejs app on heroku for the first time, but I'm stuck at the command "heroku open" since it gives me an application error and no information as to where it crashed. The app runs locally without problem.
How would you proceed to debug this?
Thanks for your advice and time.
If running heroku local does not help, run a remote shell:
heroku run -a <your app name> /bin/bash, and there run npm start to see the logs and debug the issue on the Heroku server.
When running your app "locally", have you tried running heroku local? This runs the app through Heroku, but on local server.

Setting up an existing Heroku application on a new machine

I've an existing project that works fine on another machine, but I've just upgraded and from within the project development directory, everytime I run a heroku command I have to post-fix it with --app
I feel like I've missed an application setup stage, but I can't figure out what, as everytime it states:
Run this command from an app folder or specify which app to use with --app APP.
Help appreciated.
You can solve this by adding the Heroku app to your .git/config folder.
If you are in the root of your project, run the following command:
git remote add heroku git#heroku.com:appname.git
This will set a line in your .git/config file which the heroku command line tool uses to figure out what app you're using :)
In other words, your local repo doesn't have Heroku app URL configured against an app name
Similarly what we do with git remote add ( we pass git URL as a destination for push/pulling of code )
that how our git know which repo/URL to hit (push/pull from )
Heroku also follows the same method/process.
All you have to do is add Heroku app URL (so that ur Heroku command have a reference for app URL )
it will know against which URL you are running your command against
To confirm if remote named Heroku has been set for your app:
git remote -v
if not configured or if you want it for an existing app
heroku git:remote -a app_name
it's a way to link your folder to the Heroku app
The Heroku recommended way:
heroku git:remote -a my-heroku-app-id -r what-i-want-to-call-it
Source: https://devcenter.heroku.com/articles/git
Run this command from an app folder or specify which app to use with --app APP
The other answers address the first part of that statement, it is perfectly acceptable to run heroku commands in any directory. For example I have a customer facing front end project /front-end and a rails based /back-end project. I often work in the /front-end directory and if I have to connect to the production database I'll run heroku run rails c -a back-end. After I exit irb then I'm back in my desired directory.

Why cant I run my rails app using heroku locally?

I am working on a new project that is using heroku, I get this error when I try to run the app locally:
Moped::Errors::ConnectionFailure at / Could not connect to any secondary or primary nodes for replica set <Moped::Cluster nodes=[<Moped::Node resolved_address="127.0.0.1:27017">]>
and I think it has something to do with Heroku because if I type
$ heroku info,
i get this error:
! You do not have access to the app disrupt.
I can't find this error anywhere on the internet, on any forums and there is nothing in the Heroku documentation.
The error normally just means that the MongoDB server is not running locally. Try starting it up by running mongod. Otherwise check you mongoid.yml to see how the development and test environments are set up to connect to MongoDB.
The other error that you get from heroku looks like a separate issue. As tolgap suggests you may just not be authenticated with heroku.

Resources