Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I've the following error with idb list-targets #675

Open
khanhduy62 opened this issue May 30, 2021 · 15 comments
Open

I've the following error with idb list-targets #675

khanhduy62 opened this issue May 30, 2021 · 15 comments

Comments

@khanhduy62
Copy link

khanhduy62 commented May 30, 2021

Please help me, I've the following error with idb list-targets
node: v10.13.0
macOS Big Sur version 11.4 (Macbook Pro 2018)
xcode 12.5

➜  ~ idb list-targets
2021-05-30 14:59:17,558 [ERROR] - root - Exception thrown in main
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/idb/common/companion.py", line 71, in parse_json_line
    return json.loads(decoded_line)
  File "/usr/local/Cellar/[email protected]/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/local/Cellar/[email protected]/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/Cellar/[email protected]/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/idb/common/companion_spawner.py", line 153, in spawn_notifier
    await self._read_notifier_output(stream=none_throws(process.stdout))
  File "/usr/local/lib/python3.9/site-packages/idb/common/companion_spawner.py", line 166, in _read_notifier_output
    update = parse_json_line(line)
  File "/usr/local/lib/python3.9/site-packages/idb/common/companion.py", line 73, in parse_json_line
    raise IdbJsonException(f"Failed to parse json from: {decoded_line}")
idb.common.companion.IdbJsonException: Failed to parse json from: 

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/idb/cli/main.py", line 287, in gen_main
    await root_command.run(args)
  File "/usr/local/lib/python3.9/site-packages/idb/common/command.py", line 90, in run
    return await self.resolve_command_from_args(args).run(args)
  File "/usr/local/lib/python3.9/site-packages/idb/cli/__init__.py", line 106, in run
    await self._run_impl(args)
  File "/usr/local/lib/python3.9/site-packages/idb/cli/__init__.py", line 149, in _run_impl
    await self.run_with_manager(
  File "/usr/local/lib/python3.9/site-packages/idb/cli/commands/target.py", line 171, in run_with_manager
    targets = await manager.list_targets()
  File "/usr/local/lib/python3.9/site-packages/idb/common/logging.py", line 113, in _async_wrapper
    raise ex
  File "/usr/local/lib/python3.9/site-packages/idb/common/logging.py", line 88, in _async_wrapper
    value = await function(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/idb/grpc/management.py", line 135, in list_targets
    await self._spawn_notifier()
  File "/usr/local/lib/python3.9/site-packages/idb/grpc/management.py", line 57, in _spawn_notifier
    await companion_spawner.spawn_notifier()
  File "/usr/local/lib/python3.9/site-packages/idb/common/companion_spawner.py", line 156, in spawn_notifier
    raise CompanionSpawnerException(
idb.common.companion_spawner.CompanionSpawnerException: Failed to spawn the idb notifier. Stderr: dyld: Library not loaded: /usr/local/opt/grpc/lib/libgrpc.15.dylib

  Referenced from: /usr/local/bin/idb_companion

  Reason: image not found

dyld: Library not loaded: /usr/local/opt/grpc/lib/libgrpc.15.dylib

  Referenced from: /usr/local/bin/idb_companion

  Reason: image not found

dyld: Library not loaded: /usr/local/opt/grpc/lib/libgrpc.15.dylib

  Referenced from: /usr/local/bin/idb_companion

  Reason: image not found

dyld: Library not loaded: /usr/local/opt/grpc/lib/libgrpc.15.dylib

  Referenced from: /usr/local/bin/idb_companion

  Reason: image not found
@ZeroCho
Copy link

ZeroCho commented May 31, 2021

Same issue for me.
I navigated to /usr/local/opt/grpc/lib and found out that I have libgrpc.16.dylib instead of libgrpc.15.dylib.
How can I match the version of libgrpc?

@khanhduy62
Copy link
Author

@ZeroCho so weird.
to be honest, I don't know how to fix it
sorry my mate :'(

@ZeroCho
Copy link

ZeroCho commented May 31, 2021

@khanhduy62 Do you also have different version of libgrpc in /usr/local/opt/grpc/lib?

@khanhduy62
Copy link
Author

@ZeroCho yes, same with you
so sad

@sachinhr10
Copy link

@ZeroCho #671 has the fix for it.

@khanhduy62 khanhduy62 reopened this Jun 1, 2021
@khanhduy62
Copy link
Author

@sachinhr10 Another issue happens. Could you help me fix it? Thanks in advance :D

➜  ~ idb list-targets
2021-06-01 21:39:11,146 [ERROR] - root - Exception thrown in main
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/idb/common/companion.py", line 71, in parse_json_line
    return json.loads(decoded_line)
  File "/usr/local/Cellar/[email protected]/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/local/Cellar/[email protected]/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/Cellar/[email protected]/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/idb/common/companion_spawner.py", line 153, in spawn_notifier
    await self._read_notifier_output(stream=none_throws(process.stdout))
  File "/usr/local/lib/python3.9/site-packages/idb/common/companion_spawner.py", line 166, in _read_notifier_output
    update = parse_json_line(line)
  File "/usr/local/lib/python3.9/site-packages/idb/common/companion.py", line 73, in parse_json_line
    raise IdbJsonException(f"Failed to parse json from: {decoded_line}")
idb.common.companion.IdbJsonException: Failed to parse json from: 

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/idb/cli/main.py", line 287, in gen_main
    await root_command.run(args)
  File "/usr/local/lib/python3.9/site-packages/idb/common/command.py", line 90, in run
    return await self.resolve_command_from_args(args).run(args)
  File "/usr/local/lib/python3.9/site-packages/idb/cli/__init__.py", line 106, in run
    await self._run_impl(args)
  File "/usr/local/lib/python3.9/site-packages/idb/cli/__init__.py", line 149, in _run_impl
    await self.run_with_manager(
  File "/usr/local/lib/python3.9/site-packages/idb/cli/commands/target.py", line 171, in run_with_manager
    targets = await manager.list_targets()
  File "/usr/local/lib/python3.9/site-packages/idb/common/logging.py", line 113, in _async_wrapper
    raise ex
  File "/usr/local/lib/python3.9/site-packages/idb/common/logging.py", line 88, in _async_wrapper
    value = await function(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/idb/grpc/management.py", line 135, in list_targets
    await self._spawn_notifier()
  File "/usr/local/lib/python3.9/site-packages/idb/grpc/management.py", line 57, in _spawn_notifier
    await companion_spawner.spawn_notifier()
  File "/usr/local/lib/python3.9/site-packages/idb/common/companion_spawner.py", line 156, in spawn_notifier
    raise CompanionSpawnerException(
idb.common.companion_spawner.CompanionSpawnerException: Failed to spawn the idb notifier. Stderr: dyld: Library not loaded: /usr/local/opt/grpc/lib/libgrpc.15.dylib

  Referenced from: /usr/local/bin/idb_companion

  Reason: image not found

dyld: Library not loaded: /usr/local/opt/grpc/lib/libgrpc.15.dylib

  Referenced from: /usr/local/bin/idb_companion

  Reason: image not found

dyld: Library not loaded: /usr/local/opt/grpc/lib/libgrpc.15.dylib

  Referenced from: /usr/local/bin/idb_companion

  Reason: image not found

dyld: Library not loaded: /usr/local/opt/grpc/lib/libgrpc.15.dylib

  Referenced from: /usr/local/bin/idb_companion

  Reason: image not found

➜  ~ 

@tmirun
Copy link

tmirun commented Jun 1, 2021

same issue here

@sachinhr10
Copy link

@khanhduy62 I was facing the same error, It appears with bigsur and xcode 12.5 and above. I built and archived idb-companion separately.
#671 (comment)
#671 (comment)
helped me to build idb-companion.

@tmirun
Copy link

tmirun commented Jun 2, 2021

will idb team fix this error?

@c-ryan747
Copy link
Contributor

I'm working on changing the idb companion to build grpc/... from source rather than dynamically linking the version installed by homebrew. This should solve most of the linking woes

@tmirun
Copy link

tmirun commented Jun 7, 2021

with last update solved for me the issue 👍

@khanhduy62
Copy link
Author

@sachinhr10 Could you describe more detail about how to archived idb-companion ?

@ZeroCho
Copy link

ZeroCho commented Jun 23, 2021

Yes, just re-install it again

brew tap facebook/fb
brew install idb-companion

@twboc
Copy link

twboc commented Jul 23, 2024

As suggested in the error message:

Referenced from: /usr/local/bin/idb_companion
Reason: image not found

In my case the error was caused by

not having the idb_companion inside /usr/local/bin/idb_companion.

Installed by brew.
I installed the companion with brew and it ended up being inside /opt/homebrew/Cellar/idb-companion/1.1.8/bin/idb_companion.
I created a symlink and flipper immediately worked.

sudo ln -s /opt/homebrew/Cellar/idb-companion/1.1.8/bin/idb_companion /usr/local/bin/idb_companion

For your information Flipper client could not find my idb as well for the same reason. Instead of changing the path to idb in settings I created a symlink as well and it worked!

sudo ln -s /opt/homebrew/bin/idb /usr/local/bin/idb

For the love of all of you I hope that this helps because I wasted a whole day because of this.

@Harkindey
Copy link

@twboc Thank you soo much.

Yall can check (facebook/flipper#3497) Also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants