I'm new to Heroku and I've noticed that their page provides a tutorial on NodeJS where they go step by step on how to integrate a project or start a new project on their platform. Through the last step there's a section for databases, using postgres as an example, which happens to be the database type I'm looking to integrate in my project as well. However, after following through with the tutorial, I noticed that when executing heroku pg:psql, the Git Bash (what I used) keeps showing Connecting to [...] (the name of the database) and nothing else happens, effectively not allowing me to create rows and whatnot in the database so I can see them as part of the application. Have I gone wrong somewhere, or am I just missing something?
I have tried multiple ways to make sure it's connecting to the right database, I have even made a new database, however nothing works and the process keeps going endlessly. I've let it run for more than a day and still goes nowhere.
According to this source, https://devcenter.heroku.com/articles/getting-started-with-nodejs#provision-a-database, I should be connected to it with that bit of code there, however the only thing that I'm shown is --> Connecting to postgresql-animate-97685 .
I just had the same mistake and could not find a solution. I spent a lot of time to understand what needs to be done for this.
As a result, as I decided:
I originally used the console from Git Bash. Instead, I tried using the standard console from Windows - cmd. And it all worked out as per the instructions from Heroku.
By the way, this is not the first time that Git Bash fails me.
Hope that helped.
Related
Today I made a change to my rails app, deployed it to Heroku, and everything seemed fine. But then, when I looked at the production website, my changes were not reflected. I ran heroku releases (and looked at their web dashboard version of this information) and indeed it shows my code should be there. It's pointing to the git commit that has my changed code in it as the one that was the most recent release.
Here's where it gets crazy: I use heroku run bash to get into the filesystem of my actual server, I use cat to view the changed file, and the new code isn't there! It's still the old version.
Has anyone seen this before? What else can I do to debug/fix this issue?
There is currently a large issue with Heroku that seems to be happening.
Their site: https://status.heroku.com/ seems to claim its only for Performance-L dynos. But if you search https://twitter.com/search?q=heroku&src=typd, you'll find convos about a lot of people not seeing the newest code deployed and/or having apps fully crashed.
The Heroku Toolbelt's login prompt has started causing my continuous integration job to fail. I'm guessing something changed in a recent version, but since this project had been on the back-burner for a few months, I'm not sure exactly when that happened. I'll also admit that I don't remember how I had this working in the first place. It's possible that I did something similar to my answer below, but have no recollection of that.
Is there any way to script completion of the login prompt or bypass it entirely using environment variables/config?
Version information:
heroku-toolbelt/3.42.40 (x86_64-linux) ruby/2.2.2
heroku-cli/4.27.26-693efcb (amd64-linux) go1.6
I've tried manually logging into Heroku on the CI server, which creates a .netrc and copying that into my image, but it appears to be ignored.
Unfortunately, the only solution I was able to come up with was to build the Docker image, create a container, run heroku login inside of it, commit the changes and use the new image in my CI workflow.
I have created database project in visual studio 2013 from existing database. Then I have done lot of changes in database project like modify stored procedures, post deployment script, table structure, etc . Now database project is ready to deploy. But I am worry if any script fails then How I can retain the original state though it build properly.
Please suggest that if any query fails then I want ROLLBACK the all changes that I have made in database project.
Firstly you need to trust your tools and either believe they will work or find other tools.
While you are building the trust I would add a create backup to the pre-deployment script or run a backup before you deploy then if anything goes wrong you can restore and figure out what went wrong.
As David said to roll-back, you would get the previously deployed dacpac and generate a new deployment script from that but fixing forward is almost always the correct thing to do rather than rolling back to a previous version.
ed
Have you been checking your changes into version control? If so, all you need to do is to revert back to the last known good version.
Or... simply work out why it's failing now and fix the root cause?
I used Db projects some time ago and as far as I remember the deploy script was wrapped in a transaction. It is possible to generate sql script without executing it. That setting was somewhere in DB project settings. You can take a look inside that script and make sure that it'll rollback on error.
Doing a backup would still be a recommended practice especially when you deploy to production.
when working on important scripts I developed a habit of always starting a transaction and commenting out the commit.
If you accidentally run it, it won't take effect. The commented out commit would only come out when the thing was done.
While this answer indicates that you CAN revert in source control (Assuming SSDT at this point) it would be nice to get a pointer to the exact process to do this. On a file by file basis the history works the same but how to revert the entire database at once isn't immediately obvious.
Being newer to Ruby on Rails and while I have a fair understanding of certain areas, I am still learning. The one area I have difficulty is migrations/databases and I fear I may have had a terrible mistake.
I am currently working on building a blog and recently added a comments section. My next project was to have friendly URLs (using the friendly_id gem) and when I needed to create a new column for slugs, it seemed to already exist (from trying at a previous time I suppose).
Anyway, I tried to reset to an older commit but I know now (unless I am mistaken) that it has no affect on migrations? After some research I tried to rollback my database to undo whatever happened with the slugs. Ultimately, I went too far back that the only database I had was for my blog posts (and nothing for the users and comments).
I have since done a rake db:migrate and everything has been generated again but the content (via the localhost) was removed. I don't mind that because the content I have on my localhost does not have everything my live site does (http://www.joedayvie.com), granted its not much there either.
Anyway, I am really lost at this point and concerned. If I git push heroku master in the console will my content be removed or will this happen when I update the migrations onto heroku? Is there anything I can do to revert prior to this whole mess happening?
I apologize for seeming quite confused (but I am 100% self taught and lost). I greatly appreciate any information anyone may be able to provide me.
Thank you so much for reading!
Joe
PS: Of course if it's possible that this may not affect my website at all, please let me know. I just want to know more information before going further - Thank you! =)
You need to read about backups on Heroku
Then - you need to create a backup of your production system on heroku and prove to yourself that you can load it, by doing so on your local system.
When you have your local system looking like your production system again, you will know that you know how to recover even if the mess does happen again.
the CI server was disconnected for a while for some strange reason from the network and when it came back up, jenkins displayed with no jobs. however in the directory where the jobs live, /var/lib/jenkins/jobs/, the two jobs that should appear are there, but don't show any evidence of existence in the web client.
i tried using the 'copy existing job' and then pointed it to /var/lib/jenkins/jobs/existing_test but it tells me: no such job /var/lib/jenkins/jobs/existing_test
any suggestions as to how to get this to work ?
I know that question can be outdated, but a possible a solution is to run jenkins under appropriate user (the one it run previously). This helped me.
ended up just building the jobs brand new, wasn't able to find a fix
At first I would try and look in the jenkins logs, as your data is in /var/lib/jenkins I would guess your log files are in /var/log/jenkins. Maybe you can find out whats wrong from there.
Also you could try the "load configuration from disk" link in the "manage jenkins" view. That should try to reload the configuration files from your directories, and maybe bring your jobs back. Anyways, you should be able to see something in your logs. If the logs are empty check file permissions, I used to have problems with that after updating sometimes.