PINPal icon indicating copy to clipboard operation
PINPal copied to clipboard

Windows 10 OSError: [WinError 1783] The stub received bad data.

Open greywidget opened this issue 1 year ago • 6 comments

Description

I was just playing with PinPal in a venv and received an error.

I set up one PinPal secret with pinpal new and ran pinpal a couple of times to try it - I got prompted as expected. I set up a second PinPal secret, ran PinPal and got prompted for them both as expected.

I logged off for a while, then some hours later logged back on for another reminder. On running pinpal I got a prompt for the first secret which was accepted. I got a prompt for the second secret and after I entered it, the following exception occurred (and keeps occurring:)

Error Log

pinpal


testme (reminder: octane utilisation):
yay
2 correct entries to go before leveling up


woody (reminder: protection mitochondrial):
yay
3 correct entries to go before leveling up
Traceback (most recent call last):
  File "C:\Users\Craig\python_projects\play\venv\Lib\site-packages\win32ctypes\pywin32\pywintypes.py", line 33, in pywin32error
    yield
  File "C:\Users\Craig\python_projects\play\venv\Lib\site-packages\win32ctypes\pywin32\win32cred.py", line 35, in CredWrite
    _authentication._CredWrite(c_pcreds, 0)
  File "C:\Users\Craig\python_projects\play\venv\Lib\site-packages\win32ctypes\core\ctypes\_util.py", line 61, in check_false
    raise make_error(function, function_name)
OSError: [WinError 1783] The stub received bad data.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\Craig\python_projects\play\venv\Scripts\pinpal.exe\__main__.py", line 7, in <module>
  File "C:\Users\Craig\python_projects\play\venv\Lib\site-packages\pinpal.py", line 645, in main
    app.save()
  File "C:\Users\Craig\python_projects\play\venv\Lib\site-packages\pinpal.py", line 590, in save
    set_password(
  File "C:\Users\Craig\python_projects\play\venv\Lib\site-packages\keyring\core.py", line 61, in set_password
    get_keyring().set_password(service_name, username, password)
  File "C:\Users\Craig\python_projects\play\venv\Lib\site-packages\keyring\backends\Windows.py", line 128, in set_password
    self._set_password(service, username, str(password))
  File "C:\Users\Craig\python_projects\play\venv\Lib\site-packages\keyring\backends\Windows.py", line 139, in _set_password
    win32cred.CredWrite(credential, 0)
  File "C:\Users\Craig\python_projects\play\venv\Lib\site-packages\win32ctypes\pywin32\win32cred.py", line 34, in CredWrite
    with _pywin32error():
  File "C:\Users\Craig\AppData\Local\Programs\Python\Python311\Lib\contextlib.py", line 155, in __exit__
    self.gen.throw(typ, value, traceback)
  File "C:\Users\Craig\python_projects\play\venv\Lib\site-packages\win32ctypes\pywin32\pywintypes.py", line 37, in pywin32error
    raise error(exception.winerror, exception.function, exception.strerror)
win32ctypes.pywin32.pywintypes.error: (1783, 'CredWrite', 'The stub received bad data.')

Environment

  • Windows 10
  • Python3.11.5 in a venv
  • Top level Packages in the environment:
python -m pip list --not-required
Package        Version
-------------- ---------
beautifulsoup4 4.11.2
pinpal         2023.4.22
pip-tools      7.3.0
shellingham    1.5.4
streamlit      1.28.1
typer          0.9.0

Thankyou for taking the time to write this utility. If you need any more info please let me know.

greywidget avatar Dec 26 '23 23:12 greywidget