Bug 242647 - Using git-webkit pr via SSH dumps errors
Summary: Using git-webkit pr via SSH dumps errors
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
: 242726 (view as bug list)
Depends on:
Blocks: 239082
  Show dependency treegraph
 
Reported: 2022-07-12 13:45 PDT by Yusuke Suzuki
Modified: 2023-01-18 11:17 PST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yusuke Suzuki 2022-07-12 13:45:52 PDT
Using git-webkit pr via SSH does not work.

```
No valid authentication session for Radar
'main' is not a pull request branch, enter issue URL or title of new issue: https://bugs.webkit.org/show_bug.cgi?id=242599
Traceback (most recent call last):
  File "/Users/yusukesuzuki/dev/OpenSource/Tools/Scripts/libraries/autoinstalled/python-3-arm64/keyring/backends/macOS/__init__.py", line 49, in get_password
    return api.find_generic_password(self.keychain, service, username)
  File "/Users/yusukesuzuki/dev/OpenSource/Tools/Scripts/libraries/autoinstalled/python-3-arm64/keyring/backends/macOS/api.py", line 144, in find_generic_password
    Error.raise_for_status(status)
  File "/Users/yusukesuzuki/dev/OpenSource/Tools/Scripts/libraries/autoinstalled/python-3-arm64/keyring/backends/macOS/api.py", line 114, in raise_for_status
    raise cls(status, "Unknown Error")
keyring.backends.macOS.api.Error: (-25308, 'Unknown Error')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/yusukesuzuki/dev/Internal/Tools/Scripts//git-webkit", line 89, in <module>
    sys.exit(program.main(
  File "/Users/yusukesuzuki/dev/OpenSource/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/__init__.py", line 148, in main
    return parsed.main(
  File "/Users/yusukesuzuki/dev/OpenSource/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/pull_request.py", line 456, in main
    branch_point = cls.pull_request_branch_point(repository, args, **kwargs)
  File "/Users/yusukesuzuki/dev/OpenSource/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/pull_request.py", line 179, in pull_request_branch_point
    if Branch.main(
  File "/Users/yusukesuzuki/dev/OpenSource/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/branch.py", line 114, in main
    if issue and issue.title and not redact and not issue.redacted:
  File "/Users/yusukesuzuki/dev/OpenSource/Tools/Scripts/libraries/webkitbugspy/webkitbugspy/issue.py", line 89, in title
    self.tracker.populate(self, 'title')
  File "/Users/yusukesuzuki/dev/OpenSource/Tools/Scripts/libraries/webkitbugspy/webkitbugspy/bugzilla.py", line 160, in populate
    response = requests.get('{}/rest/bug/{}{}'.format(self.url, issue.id, self._login_arguments(required=False)))
  File "/Users/yusukesuzuki/dev/OpenSource/Tools/Scripts/libraries/webkitbugspy/webkitbugspy/bugzilla.py", line 138, in _login_arguments
    username, password = self.credentials(required=required)
  File "/Users/yusukesuzuki/dev/OpenSource/Tools/Scripts/libraries/webkitbugspy/webkitbugspy/bugzilla.py", line 124, in credentials
    return webkitcorepy.credentials(
  File "/Users/yusukesuzuki/dev/OpenSource/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/credentials.py", line 71, in credentials
    username = keyring.get_password(url, 'username')
  File "/Users/yusukesuzuki/dev/OpenSource/Tools/Scripts/libraries/autoinstalled/python-3-arm64/keyring/core.py", line 55, in get_password
    return get_keyring().get_password(service_name, username)
  File "/Users/yusukesuzuki/dev/OpenSource/Tools/Scripts/libraries/autoinstalled/python-3-arm64/keyring/backends/macOS/__init__.py", line 55, in get_password
    raise KeyringError("Can't get password from keychain: " "{}".format(e))
keyring.errors.KeyringError: Can't get password from keychain: (-25308, 'Unknown Error')
```
Comment 1 Alexey Proskuryakov 2022-07-13 13:51:07 PDT
I suspect that this may be unfixable as long as we use Keychain for credentials.
Comment 2 Alexey Proskuryakov 2022-07-14 14:50:24 PDT
Elliott pointed out in bug 242726 that keychain does work over ssh. So we just need to run `security unlock`, which will ask for user's password.
Comment 3 Yusuke Suzuki 2022-07-17 17:53:47 PDT
(In reply to Alexey Proskuryakov from comment #2)
> Elliott pointed out in bug 242726 that keychain does work over ssh. So we
> just need to run `security unlock`, which will ask for user's password.

Nice!!! Thank you
Comment 4 Radar WebKit Bug Importer 2022-07-19 13:46:15 PDT
<rdar://problem/97279550>
Comment 5 Yusuke Suzuki 2022-07-19 14:11:31 PDT
I think git-webkit should detect this condition, and instead of crashing, suggest `security unlock` and/or do `security unlock` to proceed.
Comment 6 Jonathan Bedard 2022-07-21 10:24:05 PDT
This does seem quite detectable, we only have a single function which access the keychain this way.
Comment 7 Ryan Haddad 2023-01-18 11:17:56 PST
*** Bug 242726 has been marked as a duplicate of this bug. ***