Comments (13)
I also tried to manually add a comment via cURL which worked without a problem:
curl -D- -X POST -H "Authorization: Bearer <token>" -H "Content-Type: application/json" https://<BitbucketServer>/rest/api/1.0/projects/<BitbucketProject>/repos/test/pull-requests/1/comments -d '{
"text": "An insightful general comment on a pull request."
}'
(Ref. Bitbucket API Docs)
from terraform-aws-atlantis.
No worries, glad that you've gotten a bit further. I don't have easy access to bitbucket server to test myself at the moment. If it turns out that for some configurations the personal access token doesn't work then a doc update PR would be awesome.
from terraform-aws-atlantis.
@trahloff Atlantis isn't using a bearer token, it's use HTTP basic auth: https://github.com/runatlantis/atlantis/blob/master/server/events/vcs/bitbucketserver/client.go#L268-L281 have you tried your curl using that?
from terraform-aws-atlantis.
@lkysow HTTP basic auth works perfectly fine via curl. I can only find documentation on how to use Bitbucket Personal Access Tokens with Atlantis and I can only find documentation for config flags that set Bitbucket user and token. Any idea how I could switch to user/password authentication? Did I miss something?
from terraform-aws-atlantis.
@trahloff is it possible that there are spurious characters added to your username or password that's being passed to Atlantis? Maybe an extra newline or space or something? You could use a custom workflow like #54 (comment) to verify.
from terraform-aws-atlantis.
@lkysow I added the custom workflow but since the authentication is not working Atlantis is not able to get the PR changes and thus cannot get the commit files and exits before it can execute the workflow.
I understood from your comment that:
ATLANTIS_BITBUCKET_TOKEN
!= Bitbucket Personal Access Token and
ATLANTIS_BITBUCKET_TOKEN
== Bitbucket Basic Auth Password
Is that correct?
from terraform-aws-atlantis.
I think I had exact same problem just recently. The problem was bad credentials as the error message suggested.
@trahloff, are you able to get a shell of your running container and do a request via curl using the same env variables (ATLANTIS_BITBUCKET_USER
and ATLANTIS_BITBUCKET_TOKEN
) that are set in your container?
Btw: ATLANTIS_BITBUCKET_TOKEN
== Bitbucket Personal Access Token
and I believe you can use it as a Bearer token as per BBS docs here. and as a basic auth password.
from terraform-aws-atlantis.
No sorry, I was just saying that if you wanted to reproduce the calls in the same way as Atlantis you should be using HTTP basic auth, not the bearer token header.
I've created a custom build of Atlantis that echoes out the credentials upon startup: runatlantis/atlantis@2f6e90e
atlantis_linux_arm.zip
atlantis_linux_amd64.zip
atlantis_linux_386.zip
atlantis_darwin_amd64.zip
Do you want to try that?
from terraform-aws-atlantis.
Thank you guys for your support!
@lkysow The custom firmware worked like a charm. The credentials were correct.
I tried to set ATLANTIS_BITBUCKET_TOKEN
to my Bitbucket password and that works. Weird that the Personal Access Token did not.
Unfortunately, I ran into the "SCM access over HTTP(S) has been disabled" error but that may be an indicator that our BBS instance has some kind of restrictive configuration that interfered with the Personal Access Token solution. I guess the problem is on our side and is not caused by Atlantis or the Terraform module.
Sorry guys and thank you again for helping me.
from terraform-aws-atlantis.
I will definitely investigate further and make a doc update PR if I find something.
@asmontas-i Are you interested in a Terraform PR adding the atlantis_bitbucket_base_url
for BBS configuration or would you like to handle this configuration via the custom_environment_variables
variable?
from terraform-aws-atlantis.
@trahloff, I see this already have been taken care of :))
from terraform-aws-atlantis.
As @asmontas-i saying, this has been resolved in #79 and is available in v2.5.0 of this module.
I am closing this issue unless I am missing something.
from terraform-aws-atlantis.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
from terraform-aws-atlantis.
Related Issues (20)
- Invalid index in module "ecs_service" in v 4.0.1 HOT 3
- security_group_egress_rules uses wrong input HOT 2
- Missing secretsmanager:GetSecretValue policy action HOT 2
- ATLANTIS_ATLANTIS_URL not correctly picked up from atlantis.fqdn HOT 3
- Allow custom ALB Security Group rules HOT 7
- Job details lost after re-deployment HOT 2
- Document that setting ATLANTIS_GH_USER breaks the github app (ATLANTIS_GH_APP_ID / ATLANTIS_GH_APP_KEY) scenario HOT 2
- Atlantis default UID of 100 vs 1000 HOT 2
- Redeploying fargate atlantis task always breaks HOT 6
- atlantis_repo_allowlist format for Atlantis and the github_repository_webhooks HOT 2
- Do we need to call github_organization_webhook instead of github_repository_webhook for * ? HOT 1
- When EFS is Enabled, the Created EFS File System has an empty 'Name' Tag HOT 2
- The ALB Target Group Name is not set to the 'name' Variable HOT 2
- No possibility to pass a created SG for Atlantis ALB to ECS Service if we set var.create_alb = true, and var.alb.create_security_group = false HOT 1
- Just curious how to allow atlantis to comment on Bitbucket PRs using this tf module. HOT 3
- (re-open #384) atlantis_repo_allowlist format for Atlantis and the github_repository_webhooks HOT 4
- "Encountering 'Unsupported attribute' Errors with OIDC Configuration in AWS LB Listener" HOT 1
- Issues with ACM Certificate Validation Timeout and ECS Service Creation Due to Target Group Association HOT 7
- Secret manager version reported changes HOT 3
- Political ware breaks Atlantis module HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terraform-aws-atlantis.