Is there a way to find out what particular BUILD f...
# general
a
Is there a way to find out what particular BUILD file an error is coming from?
h
What error are you seeing? Usually the error messages do give useful context
coke 1
e
If the BUILD file path is not in the error message, that's a bug.
h
Oh, and which version of Pants?
a
It is… SORT OF there. But, yeah.
Copy code
21:56:06.07 [ERROR] 1 Exception encountered:

Engine traceback:
  in select
  in pants.vcs.changed.find_changed_owners
  in pants.backend.project_info.dependees.find_dependees
  in pants.backend.project_info.dependees.map_addresses_to_dependees
  in pants.engine.internals.graph.resolve_dependencies (integrations/mailbox/addin/src/integrations/mailbox/addin/__init__.py:../../../lib)
  in pants.backend.python.target_types_rules.validate_python_dependencies
  in pants.engine.internals.graph.resolve_target (requirements/python:structlog)
  in pants.engine.internals.graph.resolve_target_parametrizations (requirements/python:structlog)
  in pants.engine.internals.build_files.find_target_adaptor (requirements/python:structlog)
Traceback (most recent call last):
  File "/Users/user/.cache/pants/setup/bootstrap-Darwin-x86_64/2.12.0_py37/lib/python3.7/site-packages/pants/engine/internals/selectors.py", line 705, in native_engine_generator_send
    res = func.send(arg)
  File "/Users/user/.cache/pants/setup/bootstrap-Darwin-x86_64/2.12.0_py37/lib/python3.7/site-packages/pants/engine/internals/build_files.py", line 169, in find_target_adaptor
    namespace=address_family.namespace,
pants.base.exceptions.ResolveError: 'structlog' was not found in namespace 'requirements/python'. Did you mean one of:
  :python
Traceback (most recent call last):
  File "/Users/user/.cache/pants/setup/bootstrap-Darwin-x86_64/2.12.0_py37/lib/python3.7/site-packages/pants/bin/daemon_pants_runner.py", line 136, in single_daemonized_run
    cancellation_latch=cancellation_latch,
  File "/Users/user/.cache/pants/setup/bootstrap-Darwin-x86_64/2.12.0_py37/lib/python3.7/site-packages/pants/bin/local_pants_runner.py", line 162, in create
    session=graph_session.scheduler_session,
  File "/Users/user/.cache/pants/setup/bootstrap-Darwin-x86_64/2.12.0_py37/lib/python3.7/site-packages/pants/init/specs_calculator.py", line 67, in calculate_specs
    ChangedAddresses, [Params(changed_request, options_bootstrapper)]
  File "/Users/user/.cache/pants/setup/bootstrap-Darwin-x86_64/2.12.0_py37/lib/python3.7/site-packages/pants/engine/internals/scheduler.py", line 576, in product_request
    self._raise_on_error([t for _, t in throws])
  File "/Users/user/.cache/pants/setup/bootstrap-Darwin-x86_64/2.12.0_py37/lib/python3.7/site-packages/pants/engine/internals/scheduler.py", line 516, in _raise_on_error
    wrapped_exceptions=tuple(t.exc for t in throws),
pants.engine.internals.scheduler.ExecutionError: 1 Exception encountered:

Engine traceback:
  in select
  in pants.vcs.changed.find_changed_owners
  in pants.backend.project_info.dependees.find_dependees
  in pants.backend.project_info.dependees.map_addresses_to_dependees
  in pants.engine.internals.graph.resolve_dependencies (integrations/mailbox/addin/src/integrations/mailbox/addin/__init__.py:../../../lib)
  in pants.backend.python.target_types_rules.validate_python_dependencies
  in pants.engine.internals.graph.resolve_target (requirements/python:structlog)
  in pants.engine.internals.graph.resolve_target_parametrizations (requirements/python:structlog)
  in pants.engine.internals.build_files.find_target_adaptor (requirements/python:structlog)
Traceback (most recent call last):
  File "/Users/user/.cache/pants/setup/bootstrap-Darwin-x86_64/2.12.0_py37/lib/python3.7/site-packages/pants/engine/internals/selectors.py", line 705, in native_engine_generator_send
    res = func.send(arg)
  File "/Users/user/.cache/pants/setup/bootstrap-Darwin-x86_64/2.12.0_py37/lib/python3.7/site-packages/pants/engine/internals/build_files.py", line 169, in find_target_adaptor
    namespace=address_family.namespace,
pants.base.exceptions.ResolveError: 'structlog' was not found in namespace 'requirements/python'. Did you mean one of:
  :python


Use -ldebug for more logs. 
See <https://www.pantsbuild.org/v2.12/docs/troubleshooting> for common issues.
Consider reaching out for help: <https://www.pantsbuild.org/v2.12/docs/getting-help>
h
What was your pants command?
So you have some BUILD file referencing
requirements/python:structlog
, it looks like? And Pants is complaining that this is not a valid target address?
a
Yes, but I have to look in the fake traceback to find it out.. And,
./pants --changed-since=0e9f53550398c7c39b5b44662d353ee56628f3d6 --changed-dependees=transitive --tag=+foo release
(this is 2.12, btw, it’s part of my neverending quest to migrate from 2.6 🙂 )
And, to be fair, the path there should be resolved:
in pants.engine.internals.graph.resolve_dependencies (lib/tests/unified_threat_feeds/integration/test_s3_feeds.py:../../../unified_threat_feeds_tests
(I did notice that path after I asked, btw, because I found it by grepping for the
:structlog
and then searched the error message for the path…)
h
Still that could be a better message!
a
It definitely could be. This one in particular was a mismerge, as I’m working on upgrading things other people are actually working. 🙂
h
@happy-kitchen-89482 the new error messages are in Pants 2.13. This was a ~week project to make these much better
a
When’s that supposed to come out, I’m already updating across 6 versions, might as well wait a bit and do 7 🙂
h
@witty-crayon-22786 hopefully end of next week? We know we have at least one more rc for a performance improvement, otherwise it's been used by several orgs for 2 weeks
👍 1
a
I assume that was meant for me? 🙂
h
sort of, I was asking Stu if he agrees with my assessment
a
Ah. Okay.
w
yea, sounds right.
a
Okay, then 2.13 it is 🙂