ifvictr / ghost-storage-github

:octocat: GitHub storage adapter for Ghost
https://npm.im/ghost-storage-github
MIT License
65 stars 12 forks source link

PNG image upload encountering error #31

Closed mattguide closed 4 years ago

mattguide commented 4 years ago

I am encountering an error when trying to upload PNG images to Github. The files do upload immediately to Github; however, if I download the image from Github, it says it is corrupt for over a minute or so. I think Github takes longer to process PNG images (even small ones ~13kB). After 2 minutes when I refresh the link to the Github PNG it appears just fine.

Using the ghost-github 1.0.2 and Ghost 2.31.0.

It may be related to the 2 other issues that are open https://github.com/ifvictr/ghost-storage-github/issues/18 and https://github.com/ifvictr/ghost-storage-github/issues/21.

Error log:

{"message":"is at 71caabd4c09d47a8a4f3124dbcf224c4b348a2c2 but expected 3a2a56b1564c71bd7379e85fc5060bf65436114d","documentation_url":"https://developer.github.com/v3/repos/contents/#create-or-update-a-file"}
Error ID:
    f943fe20-f0f4-11e9-b055-73d3faf0bf5b
Error Code:
    409
----------------------------------------
InternalServerError: {"message":"is at 71caabd4c09d47a8a4f3124dbcf224c4b348a2c2 but expected 3a2a56b1564c71bd7379e85fc5060bf65436114d","documentation_url":"https://developer.github.com/v3/repos/contents/#create-or-update-a-file"}
    at new GhostError (/var/www/ghost/versions/2.31.0/core/server/lib/common/errors.js:10:26)
    at _private.prepareError (/var/www/ghost/versions/2.31.0/core/server/web/shared/middlewares/error-handler.js:51:19)
    at Layer.handle_error (/var/www/ghost/versions/2.31.0/node_modules/express/lib/router/layer.js:71:5)
    at trim_prefix (/var/www/ghost/versions/2.31.0/node_modules/express/lib/router/index.js:315:13)
    at /var/www/ghost/versions/2.31.0/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/www/ghost/versions/2.31.0/node_modules/express/lib/router/index.js:335:12)
    at next (/var/www/ghost/versions/2.31.0/node_modules/express/lib/router/index.js:275:10)
    at Layer.handle_error (/var/www/ghost/versions/2.31.0/node_modules/express/lib/router/layer.js:67:12)
    at trim_prefix (/var/www/ghost/versions/2.31.0/node_modules/express/lib/router/index.js:315:13)
    at /var/www/ghost/versions/2.31.0/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/www/ghost/versions/2.31.0/node_modules/express/lib/router/index.js:335:12)
    at next (/var/www/ghost/versions/2.31.0/node_modules/express/lib/router/index.js:275:10)
    at /var/www/ghost/versions/2.31.0/node_modules/express/lib/router/index.js:635:15
    at next (/var/www/ghost/versions/2.31.0/node_modules/express/lib/router/index.js:260:14)
    at next (/var/www/ghost/versions/2.31.0/node_modules/express/lib/router/route.js:127:14)
    at apiImpl.then.then.catch (/var/www/ghost/versions/2.31.0/core/server/api/shared/http.js:97:17)
ifvictr commented 4 years ago

@mattguide Yeah, this is definitely related to #18 and #21. Haven't had time to work on a fix yet—please make a PR if you've found the solution! Closing this so there aren't duplicate issues.