Skip to content

fix: Normalize API URLs to handle trailing slashes in Config API resolution#922

Merged
Aaron ("AJ") Steers (aaronsteers) merged 1 commit intomainfrom
devin/1766094723-fix-config-api-url-normalization
Dec 18, 2025
Merged

fix: Normalize API URLs to handle trailing slashes in Config API resolution#922
Aaron ("AJ") Steers (aaronsteers) merged 1 commit intomainfrom
devin/1766094723-fix-config-api-url-normalization

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Dec 18, 2025

Summary

Fixes an issue where MCP tools (list_cloud_workspaces, check_airbyte_cloud_workspace) would fail with "Missing AIRBYTE_CLOUD_CONFIG_API_URL" when the API URL contained a trailing slash or other minor variants.

Root cause: get_config_api_root() used exact string comparison (api_root == CLOUD_API_ROOT) which failed for URLs like https://api.airbyte.com/v1/ (with trailing slash).

Changes:

  1. api_util.py: Normalize URLs by stripping trailing slashes before comparison
  2. workspaces.py: Handle NotImplementedError in get_organization(raise_on_error=False) so the method degrades gracefully instead of crashing

Review & Testing Checklist for Human

  • Verify the URL normalization logic is sufficient (only strips trailing slashes - doesn't handle case differences or other URL variants)
  • Confirm catching NotImplementedError in get_organization() won't mask unrelated programming errors
  • Test with MCP server using bearer token authentication to verify the fix works end-to-end

Recommended test plan:

  1. Run the MCP server with bearer token auth
  2. Call check_airbyte_cloud_workspace and list_cloud_workspaces tools
  3. Verify they no longer fail with the Config API URL error

Notes

Important

Auto-merge enabled.

This PR is set to merge automatically when all requirements are met.

Note

Auto-merge may have been disabled. Please check the PR status to confirm.

…lution

- Strip trailing slashes when comparing api_root to CLOUD_API_ROOT in get_config_api_root()
- Handle NotImplementedError in CloudWorkspace.get_organization() when raise_on_error=False

This fixes issues where MCP tools like list_cloud_workspaces and check_airbyte_cloud_workspace
would fail with 'Missing AIRBYTE_CLOUD_CONFIG_API_URL' when the API URL had a trailing slash.

Co-Authored-By: aldo.gonzalez@airbyte.io <aldo.gonzalez@airbyte.io>
@devin-ai-integration
Copy link
Contributor Author

Original prompt from aldo.gonzalez@airbyte.io
Received message in Slack channel #ask-devin-ai:

@Devin Can you investigate problems with these tools when using bearer token in headers for authentication?
```Based on my interactions with your workspace, here's a summary of tool functionality:

✅ Working Tools
list_deployed_cloud_connections - Successfully retrieved your connections
describe_cloud_source - Successfully got source details
describe_cloud_organization - Successfully retrieved organization info
❌ Failing Tools
list_cloud_workspaces - Configuration issue: Missing AIRBYTE_CLOUD_CONFIG_API_URL
check_airbyte_cloud_workspace - Same configuration issue
🔍 Analysis
The tools that work are using the standard Airbyte Cloud API, while the failing tools appear to require a separate "Config API" endpoint that isn't properly configured in the environment.

🟡 Untested Tools (likely working based on successful patterns)
Most other tools should work fine, including:

Connection management (describe, rename, update)
Destination operations
Sync operations (run, status, logs)
Source/destination deployment
Custom connector management
The core functionality for managing your existing Airbyte resources appears to be fully operational. The only limitation is workspace discovery and workspace-level information retrieval.

Would you like me to test any specific functionality, or is there something particular you'd like to work on with your Facebook Marketing → S3 connection?```
Thread URL: https://airbytehq-team.slack.com/archives/C08BHPUMEPJ/p1766093669173369

@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@github-actions
Copy link

👋 Greetings, Airbyte Team Member!

Here are some helpful tips and reminders for your convenience.

Testing This PyAirbyte Version

You can test this version of PyAirbyte using the following:

# Run PyAirbyte CLI from this branch:
uvx --from 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1766094723-fix-config-api-url-normalization' pyairbyte --help

# Install PyAirbyte from this branch for development:
pip install 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1766094723-fix-config-api-url-normalization'

Helpful Resources

PR Slash Commands

Airbyte Maintainers can execute the following slash commands on your PR:

  • /fix-pr - Fixes most formatting and linting issues
  • /poetry-lock - Updates poetry.lock file
  • /test-pr - Runs tests with the updated PyAirbyte
  • /prerelease - Builds and publishes a prerelease version to PyPI

Community Support

Questions? Join the #pyairbyte channel in our Slack workspace.

📝 Edit this welcome message.

@github-actions
Copy link

PyTest Results (Fast Tests Only, No Creds)

348 tests  ±0   348 ✅ ±0   6m 5s ⏱️ +16s
  1 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 35e38ee. ± Comparison against base commit 525fec1.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! ✅

@github-actions
Copy link

github-actions bot commented Dec 18, 2025

Prerelease Build Started

Building and publishing prerelease package from this PR...
Check job output.
Prerelease Published to PyPI

Version: 0.35.2.dev92220352804337
View publish workflow

Install with:

pip install airbyte==0.35.2.dev92220352804337

@aaronsteers Aaron ("AJ") Steers (aaronsteers) merged commit 0f76d41 into main Dec 18, 2025
25 checks passed
@aaronsteers Aaron ("AJ") Steers (aaronsteers) deleted the devin/1766094723-fix-config-api-url-normalization branch December 18, 2025 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants