Skip to content

fix(logs): remove duplicated /api/v1 prefix in deploy logs URL - #8421

Open
HosnainRafi wants to merge 6 commits into
netlify:mainfrom
HosnainRafi:fix/8352-deploy-logs-duplicate-api-v1
Open

fix(logs): remove duplicated /api/v1 prefix in deploy logs URL#8421
HosnainRafi wants to merge 6 commits into
netlify:mainfrom
HosnainRafi:fix/8352-deploy-logs-duplicate-api-v1

Conversation

@HosnainRafi

Copy link
Copy Markdown

Problem

netlify logs --source deploy fails with 404 Not Found because the CLI sends the historical deploy-log request to a URL containing a duplicated /api/v1 prefix:

GET https://api.netlify.com/api/v1/api/v1/deploys/<deploy-id>/log
404 Not Found

The root cause is that fetchDeployHistoricalLogs appends /api/v1/deploys/... to the apiBase parameter, but client.basePath already contains the full /api/v1 prefix (e.g., https://api.netlify.com/api/v1).

Fix

Changed the URL construction in src/commands/logs/sources/deploy.ts from:

`${apiBase}/api/v1/deploys/${encodeURIComponent(deployId)}/log`

to:

`${apiBase}/deploys/${encodeURIComponent(deployId)}/log`

This produces the correct URL: https://api.netlify.com/api/v1/deploys/<deploy-id>/log

Tests

Added a new unit test file tests/unit/commands/logs/deploy-source.test.ts with 4 test cases:

  1. Verifies the URL does not contain duplicated /api/v1 prefix
  2. Verifies correct URL format when apiBase already ends with /api/v1
  3. Verifies empty array is returned for non-array response
  4. Verifies error is thrown on non-ok response

All tests pass, ESLint clean, Prettier formatted.

Fixes #8352

HosnainRafi and others added 6 commits August 16, 2026 19:59
Redirects silently failed to match when a leading/trailing space was
present in the address (e.g. `to = " https://example.com"`), which is a
common typo that is hard to spot. Trimming the values in the redirect
normalizer resolves the issue while preserving the parsed rule shape.

Fixes netlify#4707
When a site uses build plugins and the user runs
without a build, config mutations made by those plugins are lost,
which is confusing. This PR prints a clear warning naming the
configured plugins and suggests .

Fixes netlify#3792
…b and GitLab

When the git remote origin uses an https URL (common for private repos
cloned with credential helpers), the netlify init manual config prompt
defaults to that https URL, which then fails the SSH protocol validation.

This PR converts https:// URLs to their SSH equivalents (git@host:path.git)
for GitHub and GitLab providers, so users get a working SSH default
instead of a URL that triggers the validation error.

Fixes netlify#4603
…xing with esbuild output

During edge functions bundling, esbuild outputs to stdout concurrently
while the deploy progress spinner is active, causing the spinner animation
to mix with build output in the terminal (see netlify#2391).

This fix skips the animated spinner for the edge-functions-bundling step
and logs a simple text status instead, avoiding the visual mixing issue.

Fixes netlify#2391
The netlify watch command shows an animated spinner while waiting for
deploys to complete. This is annoying for users who switch away from
the terminal (e.g., in tmux) since the spinner constantly updates and
marks the window as having new output even though nothing useful changed.

This PR suppresses the spinner when --silent or --json is passed,
allowing users to run netlify watch --silent for a quiet mode that
only prints when a deploy completes.

Fixes netlify#5301
The `fetchDeployHistoricalLogs` function appends `/api/v1/deploys/...`
to the apiBase parameter, but client.basePath already contains the
full `/api/v1` prefix. This results in a URL like
`https://api.netlify.com/api/v1/api/v1/deploys/...` which returns 404.

Fix: use `${apiBase}/deploys/...` instead of `${apiBase}/api/v1/deploys/...`.

Fixes netlify#8352
@HosnainRafi
HosnainRafi requested a review from a team as a code owner August 16, 2026 23:56
@coderabbitai

coderabbitai Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@HosnainRafi, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 11 minutes

Limit details: You’ve used all 4 included reviews currently available under your plan.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9e752935-347d-4069-b0b3-dde0c153dfc3

📥 Commits

Reviewing files that changed from the base of the PR and between 85c0113 and fd6bcb2.

📒 Files selected for processing (9)
  • src/commands/deploy/deploy.ts
  • src/commands/logs/sources/deploy.ts
  • src/commands/watch/watch.ts
  • src/utils/detect-server-settings.ts
  • src/utils/init/config-manual.ts
  • src/utils/redirects.ts
  • tests/unit/commands/logs/deploy-source.test.ts
  • tests/unit/utils/redirects.test.ts
  • tests/unit/utils/to-ssh-url.test.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

logs --source deploy returns 404 due to duplicated /api/v1 in request URL

1 participant