question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

insufficient permission for adding an object to repository database .git/objects

See original GitHub issue

Hello,

Does anyone know how to resolve this error when this action tries to push commit?

Error: Error: error: insufficient permission for adding an object to repository database .git/objects error: modules/create_budget_alert/USAGE.md: failed to insert into database error: unable to index file 'modules/create_budget_alert/USAGE.md' fatal: updating files failed

v9.0.0

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:6
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
raiguardcommented, May 29, 2022

Running git add . results in the same thing.

I’m not bothered to fix it at this point, I’m moving all of my projects to Sourcehut and their CI is much simpler to work with. I think you can probably close this issue though, as it doesn’t seem to be a problem with your action.

1reaction
pfilourencocommented, Apr 27, 2022

Please add a link to the workflow you’re using and the failed action run. If the repo you’re having the issue is is private, please add a copy of the workflow and the logs of the step

Workflow:

tf-docs:
    name: Create Tf docs for modules
    runs-on: ubuntu-latest
    #needs: ["tf-startup"]
    steps:
      - name: Checkout the code
        uses: actions/checkout@v3
        with:
          fetch-depth: 0
          persist-credentials: true
          token: ${{ secrets.PAT_REPO }}
          ref: ${{ github.event.pull_request.head.ref }}
      - name: Import GPG key
        id: import_gpg
        uses: crazy-max/ghaction-import-gpg@v4.4.0
        with:
          git_config_global: true
          git_user_signingkey: true
          git_commit_gpgsign: true
          git_tag_gpgsign: true
          gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
          passphrase: ${{ secrets.GPG_PASSPHRASE }}
      - name: Render terraform docs for Modules inside the USAGE.md and push changes back to PR branch
        uses: terraform-docs/gh-actions@v1.0.0
        with:
          find-dir: ./modules/
          output-method: replace
          git-push: false
          git-push-user-email: xxxx@xxxx
          git-push-user-name: xxxx
          output-file : USAGE.md
          template: |-
            <!--- BEGIN_TF_DOCS --->
            {{ .Content }}
            <!--- END_TF_DOCS --->
      - name: Add & Commit terraform docs
        uses: EndBug/add-and-commit@v9.0.0
        if: github.event_name == 'pull_request'
        with:
          # Arguments for the git add command
          add: "."
          #default_author: github_actions
          author_name: xxxx
          author_email: xxxx@xxxx
          committer_name: xxxx
          committer_email: xxxx@xxxx
          message: "terraform-docs automated action"
          push: true

Logs:

Run EndBug/add-and-commit@v[9](https://github.com/nosportugal/terraform-aws-org/runs/6181630734?check_suite_focus=true#step:6:9).0.0
  with:
    add: .
    author_name: xxxx
    author_email: xxxx
    committer_name: xxxx
    committer_email: xxxx
    message: terraform-docs automated action
    push: true
    cwd: .
    default_author: github_actor
    pathspec_error_handling: ignore
    github_token: ***
  env:
    APPLY_FIXES: none
    APPLY_FIXES_EVENT: pull_request
    APPLY_FIXES_MODE: commit

Running in /home/runner/work/terraform-aws-org/terraform-aws-org
Add input parsed as single string, running 1 git add command.
> Using 'xxxx<xxxx@xxxx>' as author.
> Using custom committer info: nosgeadmin xxxx<xxxx@xxxx>
> Using "terraform-docs automated action" as commit message.
Internal logs
  > Staging files...
  > Adding files...
  Error: Error: error: insufficient permission for adding an object to repository database .git/objects
  error: modules/create_budget_alert/USAGE.md: failed to insert into database
  error: unable to index file 'modules/create_budget_alert/USAGE.md'
  fatal: updating files failed
  
Outputs
  committed: false
  commit_long_sha: undefined
  commit_sha: undefined
  pushed: false
  tagged: false
  tag_pushed: false
Error: Error: error: insufficient permission for adding an object to repository database .git/objects
error: modules/create_budget_alert/USAGE.md: failed to insert into database
error: unable to index file 'modules/create_budget_alert/USAGE.md'
fatal: updating files failed
Read more comments on GitHub >

github_iconTop Results From Across the Web

Git Push Error: insufficient permission for adding an object to ...
The repository isn't configured to be a shared repository (see core. · The operating system doesn't interpret a setgid bit on directories as...
Read more >
How to Fix Git Push Insufficient Permission Error for Objects ...
Set the Appropriate Permissions on Objects Directory · Make sure all your users who need access to git are part of the git...
Read more >
Issues - GitHub
Run git remote update git remote update shell: /bin/bash -e {0} Fetching origin error: insufficient permission for adding an object to ...
Read more >
Sometimes when I try to push my projects to ... - Medium
Insufficient permission for adding an object to repository database .git/objects. A fast way to fix this is to go in the project root...
Read more >
Git Push Error: insufficient permission for adding ... - Intellipaat
When I try to push to a shared git remote, I get the following error: insufficient permission for adding an object to the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found