Hello All. Weird issue we're having. When we're ru...
# general
k
Hello All. Weird issue we're having. When we're running
./pants test <some_app_that_puts_files_to_s3>
locally, it works. inside circleCI, same exact command fails on creds.. The credentials for AWS are working in CircleCI because other non-pants apps are using them. Any hint anyone? I'm assuming the test runs in sort of a "chrooted" environment, but why does it work locally but not in circleCI? thanks 🙂
1
h
k
thanks a lot all, will try 🙂
although.. why is it running locally? shouldn't it behave the same?
p
yes. this is weird... I would expect it to fail locally.... @hundreds-father-404?
k
i know that lerna for example has this.. CI detection thing, so there's the potential of a bit of a different run between local and CI. but i haven't seen aything of the sort with pants.
h
yeah I would expect it to fall in both! I wonder if the test is written to behave differently depending on CI, perhaps?
k
welp it doesn't 🙂 i reset everything. i delete the caches, remove dists, removed .pants.d, killed the process.. same exact git repo, same exact commit. CI fails, local works 🤔
im wondering how boto3 looks for credentials. We're not setting any interesting envvars, so im thinking more of filesystem direction. when the test runs, it first builds the pex and then runs it from an alternate "root" right? so maybe it doesn't find .aws there? still doesn't explain the discrepency between CI and local, but i think that's the direction for further investigation
p
yes. boto3 will lookup creds in multiple places, not just env variables. so it is possible that when u run locally it is able to grab it from elsewhere. for example from
~/.aws/credentials
k
hmm that's interesting actually. now that i think of it, maybe the aws credentials are provided with env-vars inside CircleCI's environment, but locally we have the ~/.aws/credentials directories
ok that's a good direction... checking the reference you gave me before about the env vars, thanks!
p
try renaming that file locally (if u have it) and see if the test still passes.
k
will report..
hmm good diea
idea*
breaks!
p
if u have logging from boto3 (this is botocore) enabled it will log where it got the creds from: https://github.com/boto/botocore/blob/f2b0dbb800b8dc2a3541334d5ca1190faf900150/botocore/credentials.py#L1303
k
very cool, so it's probably the env vars being removed on CircleCI...
ahh nice i'll try that too, thank you very much!
p
boto והשטויות שלו
😆 1
k
heheh naa it's my fault.. for some reason i was sure that we're also using file based auth on circle
that - coupled with my very basic (for now) pantsbuild knowledge..
WORKS!
Thank you so much @polite-garden-50641 and @hundreds-father-404
❤️ 1
🔥 1
🙏