I'm getting an error without much of a stack trace...
# general
r
I'm getting an error without much of a stack trace while trying to build a very basic docker image and I can't figure out why for the life of me. Below is the error with the generic stack trace, plus some of the trace level logging. I'm pretty sure the error is occurring somewhere in the
create_docker_build_context
rule, and the last thing I'm seeing is it spitting out the list of packages it built for the image, but it's swallowing the actual error it seems.
Copy code
12:11:56.53 [TRACE] Completed: pants.backend.docker.util_rules.docker_build_context.create_docker_build_context
12:11:56.53 [TRACE] Completed: pants.backend.docker.goals.package_image.build_docker_image
12:11:56.53 [TRACE] Completed: pants.core.goals.package.environment_aware_package
12:11:56.53 [DEBUG] Completed: `package` goal
12:11:56.53 [TRACE] Completed: select
12:11:56.53 [DEBUG] computed 1 nodes in 5.899770 seconds. there are 7134 total nodes.
12:11:56.53 [ERROR] 1 Exception encountered:

Engine traceback:
  in select
    ..
  in pants.core.goals.package.package_asset
    `package` goal

Traceback (most recent call last):
  File "/Users/nick.dellosa/Library/Caches/nce/695a0515ecce6747a3e42742caf246ea42091f11bfbdd8d95ea0903e90eb510a/bindings/venvs/2.19.0rc5/lib/python3.9/site-packages/pants/core/goals/package.py", line 165, in package_asset
    packages = await MultiGet(
  File "/Users/nick.dellosa/Library/Caches/nce/695a0515ecce6747a3e42742caf246ea42091f11bfbdd8d95ea0903e90eb510a/bindings/venvs/2.19.0rc5/lib/python3.9/site-packages/pants/engine/internals/selectors.py", line 374, in MultiGet
    return await _MultiGet(tuple(__arg0))
  File "/Users/nick.dellosa/Library/Caches/nce/695a0515ecce6747a3e42742caf246ea42091f11bfbdd8d95ea0903e90eb510a/bindings/venvs/2.19.0rc5/lib/python3.9/site-packages/pants/engine/internals/selectors.py", line 172, in __await__
    result = yield self.gets
TypeError: 'NoneType' object is not iterable
This is using version 2.19.0rc5
g
Does this work in 2.18? Or does it rely on some 2.19 functionality?
r
Ooh, I was able to get the actual stack trace with 2.18!
Concerning that 2.19 is swallowing the stack trace though.
g
~Great! That makes debugging easier, and means this is not a regression (in the docker backend).
What is the stacktrace in 2.18?
r
It's my custom tagging plugin that is breaking it for this particular target.
So no issue with the docker backend.
g
Ack, thanks. I'm working on 2.19 release so would be a shame with a last minute blocker. On topic, does
pkill pantsd
between runs affect what gets outputted? Also maybe
--no-local-cache
might affect it. I assume you're already using
--print-stacktrace
in both versions.
r
yeah let me jump back to 2.19 and try some stuff
I fixed the issue in my plugin and now it's giving me an (unrelated) error with an actual stack trace. But when I put the old code back in place, same thing, no stack trace, even with no local cache and killed
pantsd
. Could it be only swallowing stack traces for union rules?
g
That doesn't sound implausible. This seems like a good thing to file a GitHub issue for, and we can get some more eyes on it there. There's been some work to change how rules work that might affect it.
When thinking a bit I think I've seen this error in my own plugin development in the past, but I can't quite pin a specific solution or issue. But we should at least make sure we get full stacktraces, if at all possible.
r
Confirmed it only effects union rules or anything called from a union rule.
c
yea, unions reenter the rule graph anew, so I'm not surprised if an error doesn't include the outter scope in the traceback.