Skip to content

devops agent cannot fetch code from github

0

Problem: DevOps Agent can't fetch code from your public GitHub repo despite it being configured in agent space settings

Repository: runyunzhou/test_aws_cicd (public) Agent Space: arn:aws:aidevops:us-east-1:409237390679:agentspace/a49c64c3-c9e7-4496-8b5f-3ab29f5b7ead

asked 9 months ago329 views

3 Answers
0

Based on the information provided, there are several potential reasons why your DevOps agent might be unable to fetch code from your GitHub repository:

  1. OAuth token issues: If you're using GitHub OAuth tokens for authentication, the token might be invalid or expired. GitHub OAuth tokens are region-specific and have limitations on how many can be used per account.

  2. Insufficient permissions: The connection to GitHub might not have the proper permissions. You need to ensure that the account used to create the connection has either organization owner permissions or admin permissions to the repository.

  3. Authentication configuration: There might be an issue with how the GitHub credentials are configured. For GitHub integration, you need to properly set up OAuth client credentials with your client ID and client secret.

  4. AWS credentials conflict: If there are AWS credential files stored on the instance (like in /root/.aws/credentials or /home/{user}/.aws/credentials), they might be interfering with the agent's ability to authenticate properly.

  5. Missing GitHub app installation: You might need to complete the "Install a new app" step of the AWS Connector for GitHub to properly establish the connection.

To resolve this issue, you could:

  • Check if your GitHub OAuth token is valid and not expired
  • Ensure you have the proper permissions on the GitHub repository
  • Verify that the OAuth client credentials are correctly configured with the appropriate client ID and secret
  • Remove any conflicting AWS credential files if they exist
  • Make sure you've completed all the necessary steps for GitHub integration, including installing the AWS Connector for GitHub app

If you're using Amazon Bedrock AgentCore Identity for GitHub integration, ensure that your OAuth2 credential provider is properly configured with the correct GitHub client ID and client secret.
Sources
Introducing Amazon Bedrock AgentCore Identity: Securing agentic AI at scale | Artificial Intelligence
AWS Code deploy cannot reach instance service | AWS re:Post
Troubleshoot GitHub token issues - AWS CodeDeploy
Troubleshooting CodePipeline - AWS CodePipeline
CodePipeline error using Codestar connection as Source: Cannot read properties of undefined (reading 'OwnerId') | AWS re:Post

answered 9 months ago

  • my repo is public and proper add in devops agent pipeline settings

0

Hey,

Hope you're keeping well.

For a public GitHub repo, the AWS DevOps agent should still be able to clone via HTTPS without authentication, so failure usually points to how the connection is configured in your Agent Space. In the AWS DevOps console, open your agent space settings, edit the source configuration, and ensure the repository URL is the full HTTPS form (https://github.com/runyunzhou/test_aws_cicd.git). If you’ve linked GitHub via an AWS Connector, verify the connection status in AWS CodeCatalyst > Settings > Connections and reauthorize if needed. Also check that the agent’s execution role has codeconnections:UseConnection permissions if you’re using a CodeConnections link to GitHub.

Thanks and regards,
Taz

answered 9 months ago

  • Hi Taz,

    Thanks for the suggestions.

    Regarding the source configuration, I'm unable to directly input a full HTTPS address in the pipeline source options on the agent space page. It only displays the repository name after I select it.

    I have configured the GitHub connection for the entire DevOps agent. This process redirected me to GitHub, where I successfully installed the "AWS DevOps Agent (us-east-1)" GitHub App and granted it full read permissions.

    Despite the successful setup, the clone still fails. Any other ideas on what I could check?

    Thanks,

0

Hey,

Hope you're keeping well.

For AWS DevOps Agent to pull from GitHub, the agent’s space must have a valid and active GitHub connection configured. In the AWS DevOps console, go to your Agent Space, check Connections, and verify the GitHub connector is authorized and linked to the correct repo. Even for public repos, the connector still needs proper authentication via the AWS Connector for GitHub app, so ensure the app is installed in your GitHub account and permissions include Contents: Read. If you recently changed repo ownership or renamed it, re‑authorize the connection to refresh credentials.

Thanks and regards,
Taz

answered 9 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.