uwolfer / gerrit-intellij-plugin

Gerrit Code Review Tool Integration for the IntelliJ Platform
Apache License 2.0
492 stars 100 forks source link

Gerrit Password dialog keeps popping up #305

Open rillig-nm opened 6 years ago

rillig-nm commented 6 years ago

I have a fresh installation of IntelliJ 2017.3 with the Gerrit plugin 1.0.5-146. When I connect to the Gerrit installation, the Gerrit Password dialog keeps popping up, and I have to enter the password several times.

The most detailed message I get is from the Test button in the settings dialog:

Can't login to https://our-local-gerrit-server/: com.urswolfer.gerrit.client.rest.http.HttpStatusException: Request not successful. Message: Unauthorized. Status-Code: 401. Content: Unauthorized.

When I enter my HTTP password into the Gerrit plugin settings, the correct number of masking dots is shown. Then, when I close the settings dialog and open it again, the number of dots is 12, which looks strange. Then, when I press the Test button, the above 401 error message is shown, and when I click on OK, there are suddenly 40 dots in the password field. When I click Test again, the same 401 error is shown.

Still, I know that the password is correct, because when I save the settings now and change to the Gerrit view, the Gerrit changes are shown. Some requests work, others don't. They also fail with a 401 error.

uwolfer commented 6 years ago

Can you please try to use another password safe on IntelliJ password settings? E.g. you could try Keepass option. There are some known issues around password saving in IntelliJ. See for example: https://youtrack.jetbrains.com/issue/WI-39390#comment=27-2655255

Please let me know if that changes anything.

yuhui0531 commented 6 years ago

I met similar situation in Intellij IDEA 2017.1.5. Gerrit Password dialog still keeps popping up even I try Keepass option in Idea system settings. It makes me feel very bad... I think I would crash if this issue continue to annoy me... :( Is there any workaround for this issues? Please... please.... plz

rillig-nm commented 6 years ago

I currently have the KeePass option enabled for IntelliJ. Even when I switch to not using KeePass, I still get the exact same behavior.

uwolfer commented 6 years ago

Did it ever work before for you @rillig-nm and @yuhui0531? I have changed password related things a few releases (months) ago.

A possible workaround you could try: deactivate "Automatically check for new notifications..." in plugin settings. Please let me know if that changes anything for you.

yuhui0531 commented 6 years ago

Many thanks for your quick response. :+1: :100: I will check your workaround as soon as possible. Another possible workaround is that we can refactor GerritSettings.java, add a new way to get the password. It looks ugly, but works.

rillig-nm commented 6 years ago

@uwolfer No, nothing changed for me.

eyalken commented 6 years ago

Keepass option + reconfigure the password in the plugin setting worked for us

eekboom commented 5 years ago

I think this bug is due to

See https://youtrack.jetbrains.com/issue/IDEA-200375 for a lot of discussion and https://youtrack.jetbrains.com/issue/IDEA-201204 for the IDEA bug.

HenkPoley commented 4 years ago

In (PhpStorm) 2020.1 this may have worsened to the Gerrit plugin never picking the right password during pushes: https://plugins.jetbrains.com/plugin/7272-gerrit/reviews

Quote:

-wind long It's a nice plugin. But in idea2020.1, it happens to ask me to inpput gerrit password everytime when I open the IDE, I dont know what`s happend

That issue I could resolve by (again) setting the Gerrit password in PhpStorm's settings (and checking it with Test). But for pushes I get a non-descript "rejected by remote". On the host it tells I do not use the correct credentials, but I have no clue where to set them.


Edit: Locally this was a problem with needing to create a new SSH key (ssh-keygen -t rsa -C my@email.address) and adding that to Gerrit.

The issue that the password request popup does not add the new correct password to the IntelliJ password storage still stands. Though the settings page correctly updates it. So maybe just redirect people to there?


It would be really nice if

my@email.address: Permission denied (publickey).
fatal: Could not read from remote repository.

Would lead to an informative message other than "Push [..] was rejected by remote".

E.g.:

You need to create an SSH key (ssh-keygen -t rsa -C my@email.address) and put the .pub contents in your user settings in Gerrit