fix: Command failed: git pull fatal: detected dubious ownership in repos... #176

Closed
opened 2026-04-05 16:19:01 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @oneuptime-dev[bot] on 1/8/2026

Exception Fix

This pull request was automatically generated by OneUptime AI Agent to fix an exception.

Exception Details

Service: home
Type: 128
Message: Command failed: git pull
fatal: detected dubious ownership in repository at '/usr/src/blog'
To add an exception for this directory, call:

git config --global --add safe.directory /usr/src/blog

Stack Trace

Error: Command failed: git pull
fatal: detected dubious ownership in repository at '/usr/src/blog'
To add an exception for this directory, call:

	git config --global --add safe.directory /usr/src/blog

    at genericNodeError (node:internal/errors:985:15)
    at wrappedFn (node:internal/errors:539:14)
    at ChildProcess.exithandler (node:child_process:417:12)
    at ChildProcess.emit (node:events:508:28)
    at ChildProcess.emit (node:domain:489:12)
    at maybeClose (node:internal/child_process:1101:16)
    at Socket.<anonymous> (node:internal/child_process:457:11)
    at Socket.emit (node:events:508:28)
    at Socket.emit (node:domain:489:12)
    at Pipe.<anonymous> (node:net:346:12)

Summary of Changes

Fix Applied: Modified Common/Server/Utils/CodeRepository/CodeRepository.ts:77-88 to add the repository path to Git's safe.directory configuration before performing the git pull operation. This is the recommended solution from Git itself, as shown in the error message.
The fix:

  1. Calls git config --global --add safe.directory <repo_path> before git pull
  2. Uses path.resolve() to ensure the path is absolute
  3. Is idempotent - adding the same directory multiple times is harmless

This PR was automatically generated by OneUptime AI Agent

*Originally created by @oneuptime-dev[bot] on 1/8/2026* ## Exception Fix This pull request was automatically generated by OneUptime AI Agent to fix an exception. ### Exception Details **Service:** home **Type:** 128 **Message:** Command failed: git pull fatal: detected dubious ownership in repository at '/usr/src/blog' To add an exception for this directory, call: git config --global --add safe.directory /usr/src/blog ### Stack Trace ``` Error: Command failed: git pull fatal: detected dubious ownership in repository at '/usr/src/blog' To add an exception for this directory, call: git config --global --add safe.directory /usr/src/blog at genericNodeError (node:internal/errors:985:15) at wrappedFn (node:internal/errors:539:14) at ChildProcess.exithandler (node:child_process:417:12) at ChildProcess.emit (node:events:508:28) at ChildProcess.emit (node:domain:489:12) at maybeClose (node:internal/child_process:1101:16) at Socket.<anonymous> (node:internal/child_process:457:11) at Socket.emit (node:events:508:28) at Socket.emit (node:domain:489:12) at Pipe.<anonymous> (node:net:346:12) ``` ### Summary of Changes **Fix Applied:** Modified `Common/Server/Utils/CodeRepository/CodeRepository.ts:77-88` to add the repository path to Git's `safe.directory` configuration before performing the `git pull` operation. This is the recommended solution from Git itself, as shown in the error message. The fix: 1. Calls `git config --global --add safe.directory <repo_path>` before `git pull` 2. Uses `path.resolve()` to ensure the path is absolute 3. Is idempotent - adding the same directory multiple times is harmless --- *This PR was automatically generated by [OneUptime AI Agent](https://oneuptime.com)*
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/oneuptime#176