bmunoz89 / alfred-wf-bluetooth-manager

Connect and disconnect a bluetooth device easily
https://www.alfredforum.com/topic/13493-bluetooth-manager-connect-and-disconnect-a-bluetooth-device-easily/
MIT License
62 stars 0 forks source link

I typed "bm" in but appeared Something went wrong #21

Closed victorchor2868 closed 9 months ago

victorchor2868 commented 10 months ago

Can you help me to fix it? today I cleaned formatted my Mac, and reinstalled your workflow and also installed Phyton 2, but I typing "bm", it showed this message.

CleanShot 2023-10-01 at 21 52 56@2x

bmunoz89 commented 10 months ago

hey @victorchor2868, did you follow these 2 steps? python-2-and-macos-monterrey and installation Why are you opening another issue? #20? 🤔

victorchor2868 commented 10 months ago

I did it, I'd followed your instruction the link you mentioned above but it's still appearing this message.

bmunoz89 commented 10 months ago

what do you get if you run these following commands in the terminal? which brew which blueutil

bmunoz89 commented 10 months ago

But the workflow error is not indicating that it has an error with any of those commands... what do you get running this command?

/usr/local/bin/python --version
victorchor2868 commented 10 months ago

I had ran the commands you mentioned.

CleanShot 2023-10-02 at 00 13 34@2x

bmunoz89 commented 10 months ago

that looks ok 🤔, could you post the workflow debug log when you run any workflow command?

victorchor2868 commented 10 months ago

that looks ok 🤔, could you post the workflow debug log when you run any workflow command?

May I know how do I get the debug log?

msimic-dev commented 9 months ago

I get the same error. I think it keeps happening since I upgraded to Sonoma, currently on 14.1. Haven't used this workflow in while so I'm not quite sure to what is is related.

[14:13:00.149] Bluetooth manager[[Script Filter](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.6B212D44-52AE-4E31-B0A2-F4624CB75C1B%3E7114F3D1-5AB9-4F16-8374-3F514C589CED)] Queuing argument '(null)'
[14:13:00.301] Bluetooth manager[[Script Filter](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.6B212D44-52AE-4E31-B0A2-F4624CB75C1B%3E7114F3D1-5AB9-4F16-8374-3F514C589CED)] Script with argv '(null)' finished
[14:13:00.307] STDERR: Bluetooth manager[[Script Filter](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.6B212D44-52AE-4E31-B0A2-F4624CB75C1B%3E7114F3D1-5AB9-4F16-8374-3F514C589CED)] 14:13:00 workflow.py:1695 DEBUG    loading cached data: /Users/msimic/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/com.alfredapp.bluetooth_manager/__workflow_latest_version.cpickle
.
14:13:00 workflow.py:2061 DEBUG    ---------- Bluetooth manager (3.0.0) ----------
14:13:00 workflow.py:1468 DEBUG    reading settings from /Users/msimic/Library/Application Support/Alfred/Workflow Data/com.alfredapp.bluetooth_manager/settings.json
14:13:00 workflow.py:2343 DEBUG    update check not due
14:13:00 bluetooth.py:40 DEBUG    Args: [u'manager']
14:13:00 bluetooth.py:74 DEBUG    blueutil command path exists
14:13:00 bluetooth.py:109 DEBUG    Command: "/opt/homebrew/bin/blueutil --power"
14:13:00 bluetooth.py:56 ERROR    Something went wrong
Traceback (most recent call last):
  File "bluetooth.py", line 50, in __init__
    self.main()
  File "bluetooth.py", line 126, in main
    is_on = self._is_on()
  File "bluetooth.py", line 117, in _is_on
    '--power',
  File "bluetooth.py", line 110, in _run_command
    output = self._wf.decode(run_command(command)).strip()
  File "/Users/msimic/Documents/01_development/01_alfred/Alfred.alfredpreferences/workflows/user.workflow.6B212D44-52AE-4E31-B0A2-F4624CB75C1B/workflow/util.py", line 185, in run_command
    return subprocess.check_output(cmd, **kwargs)
  File "/Users/msimic/.pyenv/versions/2.7.18/lib/python2.7/subprocess.py", line 223, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
CalledProcessError: Command '['/opt/homebrew/bin/blueutil', '--power']' returned non-zero exit status -6
14:13:00 workflow.py:2254 DEBUG    set last run version: 3.0.0
14:13:00 workflow.py:2103 DEBUG    ---------- finished in 0.040s ----------
[14:13:00.308] Bluetooth manager[[Script Filter](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.6B212D44-52AE-4E31-B0A2-F4624CB75C1B%3E7114F3D1-5AB9-4F16-8374-3F514C589CED)] {
  "items": [
    {
      "arg": "workflow:help",
      "valid": true,
      "subtitle": "Press enter to go to the help page",
      "icon": {
        "path": "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns"
      },
      "title": "Something went wrong"
    }
  ]
}

hey @victorchor2868, did you follow these 2 steps? python-2-and-macos-monterrey and installation Why are you opening another issue? #20? 🤔

I've followed your steps you mentioned here. And here is my location for brew and blueutil which I have set in the workflow variables (it worked a couple of weeks ago)

which brew
/opt/homebrew/bin/brew

which blueutil
/opt/homebrew/bin/blueutil
bmunoz89 commented 9 months ago

@msimic-dev I had that same problem when I upgraded to Sonoma, I fixed it by updating the blueutil package, the problem comes when the command blueutil --power fails, for example if I run the command in my terminal this is what I get:

> blueutil --power
1

A normal response it should be a 0 or 1.

Let me know if that helps you.

msimic-dev commented 9 months ago

Just checked and I already have the newest blueutil version (2.9.1). The output for blueutil --poweris the same for me but the error still occurs.

bmunoz89 commented 9 months ago

That's weird, the command in the workflow is throwing an error -6, the only other option I can think of is that could be something related with Alfred, so maybe killing it and opening it again could help.

msimic-dev commented 9 months ago

I researched the issue a bit further and Alfred did not have a bluetooth permission. Not sure if it was needed before Sonoma but it works now. Thanks for your help.

bmunoz89 commented 9 months ago

Oh I didn't know that! awesome

victorchor2868 commented 9 months ago

Thanks.

This is also helped me to solve the problem.

me too also for bluetooth does not have bluetooth permission, after activated in the setting, now workflow could worked already.