tilmanginzel / alfred-bluetooth-workflow

Yet another Alfred workflow to connect / disconnect Bluetooth devices
MIT License
189 stars 8 forks source link

Bad CPU type error after upgrade to latest version #26

Closed wilbeibi closed 3 years ago

wilbeibi commented 3 years ago

Alfred's debug output:

[14:32:06.683] Logging Started...
[14:32:08.879] Bluetooth Connector[Script Filter] Queuing argument ''
[14:32:09.084] Bluetooth Connector[Script Filter] Script with argv '(null)' finished
[14:32:09.086] ERROR: Bluetooth Connector[Script Filter] Code 1: .
14:32:09 workflow.py:2055 DEBUG    ---------- Bluetooth Connector (0.11.0) ----------
14:32:09 workflow.py:1462 DEBUG    reading settings from /Users/hongyis/Library/Application Support/Alfred/Workflow Data/de.tilmanginzel.alfred.bluetooth/settings.json
14:32:09 workflow.py:2339 DEBUG    update check not due
14:32:09 workflow.py:1689 DEBUG    loading cached data: /Users/hongyis/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/de.tilmanginzel.alfred.bluetooth/__workflow_update_status.cpickle
14:32:09 workflow.py:2269 DEBUG    update_data: {u'available': False, u'version': u'v0.11.0', u'download_url': u'https://github.com/tilmanginzel/alfred-bluetooth-workflow/releases/download/v0.11.0/Bluetooth.Connector.alfredworkflow'}
14:32:09 workflow.py:2074 ERROR    [Errno 86] Bad CPU type in executable
Traceback (most recent call last):
  File "/Users/hongyis/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.A03D9CC6-D4EE-4B35-A604-4E8496C5D1DA/workflow/workflow.py", line 2067, in run
    func(self)
  File "alfred_bluetooth_workflow.py", line 40, in main
    devices = _read_devices()
  File "alfred_bluetooth_workflow.py", line 12, in _read_devices
    proc = subprocess.Popen(['./blueutil', '--paired', '--format=JSON'], stdout=subprocess.PIPE)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 394, in __init__
    errread, errwrite)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1047, in _execute_child
    raise child_exception
OSError: [Errno 86] Bad CPU type in executable
14:32:09 workflow.py:2097 DEBUG    ---------- finished in 0.056s ----------
[14:32:09.089] Bluetooth Connector[Script Filter] {"items": [{"valid": false, "subtitle": "[Errno 86] Bad CPU type in executable", "icon": {"path": "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns"}, "title": "Error in workflow 'Bluetooth Connector'"}]}

OS: BigSur 11.5.2, Intel

wilbeibi commented 3 years ago

Weird, when I try blueutil --paired --format=JSON from terminal, it works fine.

wilbeibi commented 3 years ago

Errr, after googling, i found this is a macOS thing, not specific to this tool, sorry, closing it.

wilbeibi commented 3 years ago

In case other people hit the same issue: I ended up fix it via replace the blueutil binary in the workflow folder with the one I installed from homebrew.

tilmanginzel commented 3 years ago

Hi @wilbeibi, I mistakenly compiled the latest blueutil binary on a M1 macbook, will publish an update tomorrow (see https://github.com/tilmanginzel/alfred-bluetooth-workflow/issues/27). Using the old binary is also fine as a workaround though.

tilmanginzel commented 3 years ago

@wilbeibi I have just published version 0.11.1 with a new binary, tested it on a M1 and Intel Macbook. Should be fixed now :)

wilbeibi commented 3 years ago

Thank you for the fix, I just updated it, it works great.

spearkkk commented 1 month ago

@wilbeibi Thanks!