Skip to content

GitHub upload conflict when uploading multiple images #792

@aciccarello

Description

@aciccarello

Description of the bug

I'm trying to narrow down the source of this error. When trying to upload a multi-photo note via IndiePass I got this error. It happened twice and each time it would upload one photo and then fail. Once I had deleted 2/3 photos the post went through.

I wonder if it's a race condition problem. Might be related to Indiepass so I'll try a different client next time.

2025-05-31T18:38:49.895Z indiekit-store:github Try creating file assets/img/2025-151-1748716728048.jpg in repo ciccarello.me, branch main
2025-05-31T18:38:51.071Z indiekit-store:github Creating file assets/img/2025-151-1748716728048.jpg
2025-05-31T18:38:51.145Z indiekit-store:github Could not create file assets/img/2025-151-1748716728048.jpg in repo ciccarello.me, branch main. Original error message: GitHub store: Conflict. Ensure the GitHub token is not expired and has the necessary permissions. You can check your tokens here: https://github.com/settings/tokens
2025-05-31T18:38:51.145Z indiekit:error Error Error: Could not create file assets/img/2025-151-1748716728048.jpg in repo ciccarello.me, branch main. Original error message: GitHub store: Conflict. Ensure the GitHub token is not expired and has the necessary permissions. You can check your tokens here: https://github.com/settings/tokens
    at GithubStore.createFile (file:///home/aciccarello/code/ciccarello-indiekit/node_modules/@indiekit/store-github/index.js:171:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.upload (file:///home/aciccarello/code/ciccarello-indiekit/lib/endpoint-media/lib/media-content.js:26:5)
    at async file:///home/aciccarello/code/ciccarello-indiekit/lib/endpoint-media/lib/controllers/action.js:45:21

Steps to reproduce

  1. Log into Indiepass micropub and configure it to use separate the micropub upload
  2. In Indiepass, create a note and attach 3 photos
  3. Submit: get error
  4. Remove all but one photo and resubmit: success

Expected behaviour

Should be able to upload multiple photos in one post.

Environment

Note config:

      "note": {
        "media": {
          "path": "assets/img/{yyyy}-{DDD}-{filename}",
        },
        "name": "Note",
        "post": {
          "path": "posts/notes/{yyyy}-{MM}-{dd}-{slug}.md",
          "url": "posts/{yyyy}/{MM}/{dd}/{slug}",
        },
      },

Additional context

I do have a fork of the endpoint-media plugin in my config repo that could be the cause but it was up to date with beta 19. I plan to upgrade to that soon.

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions