Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

importing files fails #15

Open
nikravi opened this issue Aug 5, 2023 · 4 comments
Open

importing files fails #15

nikravi opened this issue Aug 5, 2023 · 4 comments

Comments

@nikravi
Copy link

nikravi commented Aug 5, 2023

when importing images on a new strapi instance, strapi-placeholder plugin fails staring at the lifecycle

> npm run strapi transfer --from https:///admin # command
ENOENT: no such file or directory, open '/opt/app/public/uploads/jase_harris_AO_Z_N_Bt_GSE_unsplash_f4fb7d6b69.jpg'
Error: ENOENT: no such file or directory, open '/opt/app/public/uploads/jase_harris_AO_Z_N_Bt_GSE_unsplash_f4fb7d6b69.jpg'
    at Object.openSync (node:fs:590:3)
    at syncFileToBuffer (/opt/node_modules/plaiceholder/dist/index.js:84081:47)
    at imageSize (/opt/node_modules/plaiceholder/dist/index.js:84120:24)
    at getImageSize (/opt/node_modules/plaiceholder/dist/index.js:84152:7)
    at loadImage (/opt/node_modules/plaiceholder/dist/index.js:84205:21)
    at getImage (/opt/node_modules/plaiceholder/dist/index.js:84272:13)
    at getPlaiceholder (/opt/node_modules/plaiceholder/dist/index.js:84350:13)
    at Object.generate (/opt/node_modules/strapi-plugin-placeholder/server/services/placeholder.js:16:32)
    at Object.generatePlaceholder (/opt/node_modules/strapi-plugin-placeholder/server/bootstrap.js:20:64)
    at Object.run (/opt/node_modules/@strapi/database/lib/lifecycles/index.js:76:35)

any ideas what is causing this?

@maybephilipp
Copy link

Check this PR: #16

You can try my temporary fork. In npm: @finsimco/strapi-plugin-placeholder

This happens because placeholder generation happens way before assets transfer/import.

Transfer should preserve existing placeholders in database/records, not generate new ones, so my PR will help.

@nikravi
Copy link
Author

nikravi commented Oct 1, 2023

Check this PR: #16

You can try my temporary fork. In npm: @finsimco/strapi-plugin-placeholder

This happens because placeholder generation happens way before assets transfer/import.

Transfer should preserve existing placeholders in database/records, not generate new ones, so my PR will help.

I got your fork and it's failing with error:

[ERROR] Error while uploading asset art_fluid_upscayl_4x_realesrgan_x4plus_b982f78f88.jpg Error: Undefined binding(s) detected when compiling WHERE. Undefined column(s): [t0.id] query: where "t0"."id" = ?

@yasssuz
Copy link
Collaborator

yasssuz commented Oct 3, 2023

Hey guys, super busy with work, but I will try to take a look at this issue in this weekend.

@maybephilipp
Copy link

I got your fork and it's failing with error

Hey @nikravi ! I checked my changes again to try to find something that could cause this error. I haven't changed any interaction with database nor something related. I have only added conditional patching of placeholder value itself and logging rules.

So, I think, less likely that this error is caused by my changes. Must be related to some version changes or completely unrelated issue.

More details needed for future investigation:)

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

No branches or pull requests

3 participants