tomy0000000 / Coinc

💰💱Alfred Workflow for currencies conversion
https://alfred.app/workflows/tomy0000000/coinc/
MIT License
56 stars 6 forks source link

Error "Error in workflow 'Coinc'" #31

Closed alwinsamson closed 1 year ago

alwinsamson commented 1 year ago

Coinc workflow is showing error, attached a screenshot. Reinstalled the workflow, getting the same error.

macOS Ventura 13.5.2 Alfred 5.1.2

Screenshot 2023-09-20 at 20 24 23

tomy0000000 commented 1 year ago

CleanShot 2023-09-20 at 23 57 08@2x

Please click the bug icon and rerun the command. This will generate a debug log in Alfred that will be more helpful in diagnosing the issue.

But based on the existing message, it's likely that your computer's network setting is preventing you from coinc fetching the latest rates. This could be a corporate, airport, or public WiFi with a denylist, or your computer's certificate is being tempered.

alwinsamson commented 1 year ago

Here's the log, tried it on two network.

[15:28:47.275] Logging Started...
[15:28:51.208] Coinc[Keyword] Processing complete
[15:28:51.209] Coinc[Keyword] Passing output '' to Script Filter
[15:28:51.227] Coinc[Script Filter] Queuing argument '(null)'
[15:28:51.651] Coinc[Script Filter] Script with argv '(null)' finished
[15:28:51.655] STDERR: Coinc[Script Filter] .
15:28:51 workflow.py:2093 DEBUG    ---------- Coinc (3.1.1) ----------
.
15:28:51 workflow.py:2093 DEBUG    ---------- Coinc (3.1.1) ----------
15:28:51 workflow.py:2114 ERROR    <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006)>
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 1348, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py", line 1286, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py", line 1332, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py", line 1281, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py", line 1041, in _send_output
    self.send(msg)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py", line 979, in send
    self.connect()
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py", line 1458, in connect
    self.sock = self._context.wrap_socket(self.sock,
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/ssl.py", line 517, in wrap_socket
    return self.sslsocket_class._create(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/ssl.py", line 1108, in _create
    self.do_handshake()
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/ssl.py", line 1379, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/User/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.FC3B4A67-2350-463A-AD48-8A10DDE48246/workflow/workflow.py", line 2107, in run
    func(self)
  File "/Users/User/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.FC3B4A67-2350-463A-AD48-8A10DDE48246/coinc/__init__.py", line 85, in convert
    init_workflow(workflow)
  File "/Users/User/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.FC3B4A67-2350-463A-AD48-8A10DDE48246/coinc/utils.py", line 77, in init_workflow
    workflow.config = Config()
                      ^^^^^^^^
  File "/Users/User/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.FC3B4A67-2350-463A-AD48-8A10DDE48246/coinc/config.py", line 31, in __init__
    currencies = load_currencies()
                 ^^^^^^^^^^^^^^^^^
  File "/Users/User/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.FC3B4A67-2350-463A-AD48-8A10DDE48246/coinc/utils.py", line 238, in load_currencies
    return refresh_currencies(path)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/User/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.FC3B4A67-2350-463A-AD48-8A10DDE48246/coinc/utils.py", line 258, in refresh_currencies
    response = request.urlopen(CURRENCY_ENDPOINT)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 519, in open
    response = self._open(req, data)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 536, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 496, in _call_chain
    result = func(*args)
             ^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 1391, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 1351, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006)>
15:28:51 workflow.py:2116 INFO     for assistance, see: https://github.com/tomy0000000/Coinc/wiki/User-Guide
15:28:51 workflow.py:2136 DEBUG    ---------- finished in 0.217s ----------
15:28:51 workflow.py:1483 DEBUG    reading settings from /Users/User/Library/Application Support/Alfred/Workflow Data/tech.tomy.coinc/settings.json
15:28:51 workflow.py:2314 DEBUG    set last run version: 3.1.1
15:28:51 workflow.py:2136 DEBUG    ---------- finished in 0.219s ----------
[15:28:51.660] Coinc[Script Filter] {
  "items": [
    {
      "title": "Error in workflow 'Coinc'",
      "subtitle": "<urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006)>",
      "valid": false,
      "icon": {
        "path": "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns"
      }
    }
  ]
}
tomy0000000 commented 1 year ago

This error is coming from your system or Python, which can not be fixed on the workflow's side.

But how do you install Python on your machine?

If you installed python from the official python.org installer, you might want to check out this StackOverflow thread.

Also, if you google urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006), there are lots of possible ways you can try to fix this issue.

If all fails, you might consider uninstalling and installing python again.

Hope this helps.