Code Monkey home page Code Monkey logo

Comments (5)

alexfrosa avatar alexfrosa commented on September 26, 2024

Hi @yangxxx28 it looks like you are sending a test event that doesn't contain all the information required by the Lambda to connect to the Bitbucket server. Try to test with a real event from Bitbucket.

from aws-codepipeline-bitbucket-integration.

yangxxx28 avatar yangxxx28 commented on September 26, 2024

@alexfrosa I made some code changes to the bitbucket. Here is the webhook event.
image
I think the event should be able to trigger lambda correctly?

from aws-codepipeline-bitbucket-integration.

alexfrosa avatar alexfrosa commented on September 26, 2024

@yangxxx28 the lambda is expecting events of changes to the repo code.

from aws-codepipeline-bitbucket-integration.

yangxxx28 avatar yangxxx28 commented on September 26, 2024

@alexfrosa I did make code changes and pushed to the bitbucket server. Below is the request:
{
"resource": "/",
"path": "/",
"httpMethod": "POST",
"headers": {
"Accept": "/",
"Content-Type": "application/json; charset=UTF-8",
"Host": "t5t3vyclwj.execute-api.ap-southeast-2.amazonaws.com",
"User-Agent": "Atlassian HttpClient 2.1.0 / Bitbucket-7.4.0 (7004000) / Default",
"Via": "1.1 localhost (Apache-HttpClient/4.5.5 (cache))",
"X-Amzn-Trace-Id": "Root=1-5f9231d7-7559a8e27dc3b2fd33409552",
"X-Event-Key": "repo:refs_changed",
"X-Forwarded-For": "52.147.3.51",
"X-Forwarded-Port": "443",
"X-Forwarded-Proto": "https",
"X-Hub-Signature": "sha256=d36d0cf272a14319a926add61d879fcc3ab851e7b24e58a9103f4c0602e5e326",
"X-Request-Id": "13efc8c6-0be4-44f7-949d-5617a5dd31a4"
},
"multiValueHeaders": {
"Accept": [
"/"
],
"Content-Type": [
"application/json; charset=UTF-8"
],
"Host": [
"t5t3vyclwj.execute-api.ap-southeast-2.amazonaws.com"
],
"User-Agent": [
"Atlassian HttpClient 2.1.0 / Bitbucket-7.4.0 (7004000) / Default"
],
"Via": [
"1.1 localhost (Apache-HttpClient/4.5.5 (cache))"
],
"X-Amzn-Trace-Id": [
"Root=1-5f9231d7-7559a8e27dc3b2fd33409552"
],
"X-Event-Key": [
"repo:refs_changed"
],
"X-Forwarded-For": [
"52.147.3.51"
],
"X-Forwarded-Port": [
"443"
],
"X-Forwarded-Proto": [
"https"
],
"X-Hub-Signature": [
"sha256=d36d0cf272a14319a926add61d879fcc3ab851e7b24e58a9103f4c0602e5e326"
],
"X-Request-Id": [
"13efc8c6-0be4-44f7-949d-5617a5dd31a4"
]
},
"queryStringParameters": null,
"multiValueQueryStringParameters": null,
"pathParameters": null,
"stageVariables": null,
"requestContext": {
"resourceId": "06qc5tsqr1",
"resourcePath": "/",
"httpMethod": "POST",
"extendedRequestId": "U1y5rFD5SwMF9fw=",
"requestTime": "23/Oct/2020:01:28:55 +0000",
"path": "/prod",
"accountId": "474830832708",
"protocol": "HTTP/1.1",
"stage": "prod",
"domainPrefix": "t5t3vyclwj",
"requestTimeEpoch": 1603416535442,
"requestId": "06ade38a-518a-4625-828a-aefbb549b162",
"identity": {
"cognitoIdentityPoolId": null,
"accountId": null,
"cognitoIdentityId": null,
"caller": null,
"sourceIp": "52.147.3.51",
"principalOrgId": null,
"accessKey": null,
"cognitoAuthenticationType": null,
"cognitoAuthenticationProvider": null,
"userArn": null,
"userAgent": "Atlassian HttpClient 2.1.0 / Bitbucket-7.4.0 (7004000) / Default",
"user": null
},
"domainName": "t5t3vyclwj.execute-api.ap-southeast-2.amazonaws.com",
"apiId": "t5t3vyclwj"
},
"body": "{"eventKey":"repo:refs_changed","date":"2020-10-23T12:28:54+1100","actor":{"name":"xxx","emailAddress":"[email protected]","id":266,"displayName":"xxx xxx","active":true,"slug":"xxx","type":"NORMAL","links":{"self":[{"href":"https://bitbucket.xxx.xxx.xx:7990/users/yxio"}]}},"repository":{"slug":"image_python_data_platform","id":12,"name":"image_python_data_platform","hierarchyId":"1756db2651d9f6d65828","scmId":"git","state":"AVAILABLE","statusMessage":"Available","forkable":true,"project":{"key":"ADL","id":22,"name":"AWS Data Lake","public":false,"type":"NORMAL","links":{"self":[{"href":"https://bitbucket.xxx.xxx.xx:7990/projects/ADL"}]}},"public":false,"links":{"clone":[{"href":"ssh://[email protected]:7999/adl/image_python_data_platform.git","name":"ssh"},{"href":"https://bitbucket.xxx.xxx.xx:7990/scm/adl/image_python_data_platform.git","name":"http"}],"self":[{"href":"https://bitbucket.xxx.xxx.xx:7990/projects/ADL/repos/image_python_data_platform/browse"}]}},"changes":[{"ref":{"id":"refs/heads/master","displayId":"master","type":"BRANCH"},"refId":"refs/heads/master","fromHash":"993fcd5b758df782d6382a535db9361427757e6a","toHash":"ed329b5102bc5ddfb84c97dae4c54320e862fefd","type":"UPDATE"}]}",
"isBase64Encoded": false
}

but the error is still:
image
image

from aws-codepipeline-bitbucket-integration.

alexfrosa avatar alexfrosa commented on September 26, 2024

Hi @yangxxx28, please check if the Lambda environment variable BITBUCKET_SERVER_URL matches your server URL like https://bitbucket.xxx.xxx.xx:7990. Error 404 means it is not finding the content in the Bitbucket server defined by this environment variable.

from aws-codepipeline-bitbucket-integration.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.