Can't connect to heroku Postgres using DataGrip - heroku-postgres

I have a problem, after I had a "database maintenance"(01), I can not connect to it through DataGrip. Instead, I see other people's logins and databases linked to them(02). I checked the correctness of my username and password several times, but nothing changes. Help me please!
(P.s When I use a URL connection in my application, everything works fine.)
01
02

I figured out what my problem was. In my carelessness.For some reason my tables were hidden automatically. I don't know how it happened, but I just went to the visibility settings and turn them on.
Sorry for taking up your time.

Related

Is it possible to get back update made on a query without backup?

I'm gonna ask a stupid but desperate question.
Is it possible to get back a query who has been updated same with before without backup of the db.
For example I have the sentence
Hello world
and someone did an update query to
Hello hell
Is there a possibility to go back to before or log where I can find when the original sentence has been created, or maybe (let's think everything is possible) a default backup of my db ?
I'm using RAILS 5, and sqlite3
Thank you
Unfortunately not "by default", Rails doesn't have anything built-in for such situations nor does it log old values when applying updates.
You might want to use https://github.com/paper-trail-gem/paper_trail if you expect this happening often.

Rails - hide database credentials

Say one is in need to create Ruby On Rails application using third party's database without the possibility to see/get the database credentials.
Above may seem pretty crazy, but I am in this exact situation right now. The application will run on my server (only I have physical/remote access), the database will be theirs (third party company) and I cannot have access to it.
Any way of encrypting the database.yml file is pointless since I can do the following:
config = Rails.configuration.database_configuration
username = config[Rails.env]["username"]
password = config[Rails.env]["password"]
I desperately need a way to achieve given goals, and I hope it is possible. Any idea will be greatly appreciated.
Well you can always run a rails console and do whatever you want on their database :/ I don't really see the point in this.
They can create a new user on the database and give you it's credentials and then limit what you can see and do on database level. You can read how to do it for PostgreSQL here.

How to clear a default username that is saved and shown everytime I visit my rails app hosted on heroku?

I'm a newbie to development and I've been trying to debug something and haven't had much luck. Please bare with rookie knowledge.
I have built a small and simple rails app that I deployed on heroku where you have to sign up as a user by creating a profile, after which you can enter an address or zipcode to find the nearest gyms in your vicinity, which triggers the google places/geocoder api and brings you some results. The app works fine, but for some reason the version on heroku by default has a user that is stored or cached? when I land on my page. I did heroku pg:psql to check and I dont even see that user in my heroku database. On my local environment it works fine and no users are shown by default on the root page of my app when I run my server.
I looked at older threads on SO and I saw somebody saying to type heroku run rake tmp:clear but that gave me this response:
Running `rake tmp:cache:clear` attached to terminal... up, run.3757
stty: standard input: unable to perform all requested operations
Any advice/help is greatly appreciated. I only have about two weeks worth of rails knowledge! Thank you.
Solved! I thought it was related to my code or some inconsistency that happened while I deployed! I stupidly had saved that user when I originally created him when my browser(chrome) prompted me, save password for user? I should have just chosen never or closed out of it. I just when into my settings and manage passwords and deleted the fact that I had chosen to save it. I love how answers get solved right after you ask for help.

MVC 4 [Authorize] is denying every user

I restarted my production webserver tonight because it was seeming slow. Since it has come back up, no users are able to get to any views with the [Authorize] attribute on them.
There has been absolutely no code changes since November. Not a single tweak or modification of any kind. I'm using the SqlMembership provider and I originally thought the issue was there with the login, but I can see that the call to MembershipProvider.ValidateUser() passes successfully (looked at a SQL trace as well as some logging). After login, I redirect the user to a view decorated with [Authorize] and get denied.
One thing to note that even makes this more strange is that if I register a new user (who gets logged in as part of the user creation process), they are able to get to [Authorize] pages just fine. But if they log out, they are unable to access the [Authorize] pages once they log back in.
I'm pulling my hair out on this one. My production site is down and literally the only thing I did was a simple server restart. I've searched around for hours and at this point have no clue what to even look into next.
If anybody has a some ideas I'd greatly appreciate them - I'm at a complete loss and have a ton of users impacted.
Well, a few windows updates later the issue fixed itself. My guess is there was an update applied but pending reboot that hosed everything up when I restarted. Then when it came back the system found a bunch more windows updates to apply. I ran through these and it fixed the problem upon the next reboot after these were applied.

Devise login stopped working

So logging in to my site has suddenly stopped working... I haven't changed the login form and yet every time I try to log in now it comes back with 'Invalid email or password'. Using a password reset link allows me to change the password and logs me in but if I log out again and try using the password I just set it doesn't work.
I'm absolutely tearing my hair out, I've run out of ideas and it's 2am here so everything's looking pretty bleak. Just some ideas about how I might debug the problem would be great.
Thanks!
So, as is often the case, this was just me being an idiot. Note to self: don't just casually run bundle update without thinking about it and without specifying the actual gem you're interested in, unless you've got a lot of free time and a plentiful supply of Prozac.
When I do get around to deliberately upgrading Devise, this is what I'll need: https://github.com/plataformatec/devise/wiki/How-To:-Upgrade-to-Devise-2.0
It's great working from home, riding solo on projects, but I do miss being part of a team - just having someone to talk to about issues that crop up really helps and keeps you out of a mental rut. StackOverflow is my team now, you lucky people, I'll make the coffees.
If the password is correct and you can't login then it points to maybe your password salt or password pepper logic having changed?
In the future, you should have a request test on you signup form so you can catch this when your code changes. Writing a test might help you debug your issue as well. I recommend Capybara for integration testing.

Resources