When I try to create products, or upload any image I receive an exception
https://gist.github.com/dzirg44/d16f5cc84087cae8c2a47b7568531db4
latest docker image versions or use development platform.
getting the same issue on Ubuntu 20.04.1 LTS, and using the latest "reaction-development-platform" images as well.
same issue .. the admin is very buggy.. it was cool to have a powerful node js ecommerce solution. but it is still very buggy. admin not working and reaction-api keep crashing. unfortunately i have to ditch this project
Unfortunately, Reaction Commerce doesn't look alive after Mailchimp ate it. Hope, this wrong though.
I can reproduce this. Working on a fix.
Some debugging notes to self:
package-link into reaction API unless you delete their "prepublishOnly" script from their package.json filecd ~/github.com/reactioncommerce/reaction-file-collections &&
cd packages/file-collections-sa-gridfs &&
npm run build &&
cd ~/github.com/reactioncommerce/reaction-development-platform/reaction &&
./bin/package-link @reactioncommerce/file-collections-sa-gridfs ../../reaction-file-collections/packages/file-collections-sa-gridfs
I'm attaching logs from reaction API with DEBUG=reaction* which provides good extra detail here. The upload is completing but the error seems to be happening during the first image resizing transformation.
Please disregard that auto-close. It was based on github automatic rules that don't understand the word might.
OK so in @reactioncommerce/file-collections 0.9.2 which I just published, I reverted the tus-js-client back to ^1.5.1, and seems to have resolved at least one or two errors with image uploads. That dep got accidentally updated to 2.x during routine dependency updates for security issues. It's a semver breaking change though and we should not have updated beyond 1.x. There are still further issues I believe with displaying the media gallery and getting the URLs right so I'll continue to debug those.
The original upload is working and we are storing a URL in mongo that is correct and will be served correctly through the API server, but the URLs for the resized versions all appear to be "null" so looking into that to fix it.
OK I've found that the background jobs to resize images are also failing due to the same bug in the error handling in reaction-file-collections FileCollection.js here.
Lots of entries in the job failures like this:
"failures" : [
{
"value" : "Failed for exceeding worker set workTimeout",
"runId" : "3ifsPCimbEFELBNuu"
},
{
"value" : "Failed for exceeding worker set workTimeout",
"runId" : "fhqoaE9JikqXqBZsR"
},
{
"value" : "Failed for exceeding worker set workTimeout",
"runId" : "Xph4Kr8fKqo5CT3rp"
},
{
"value" : "Failed to convert temporary image from jyQSTH4CBxd2STchB. Error: TypeError: Cannot read property 'message' of undefined",
"runId" : "6M58XZHC3NmWuS3ww"
},
{
"value" : "Failed to convert temporary image from jyQSTH4CBxd2STchB. Error: TypeError: Cannot read property 'message' of undefined",
"runId" : "nFHCggTzXDHy6BbEh"
},
{
"value" : "Failed to convert temporary image from jyQSTH4CBxd2STchB. Error: TypeError: Cannot read property 'message' of undefined",
"runId" : "5yXsi5aNjgDH9Zuwj"
}
OK this is a deep maze to trace through, but so far my analysis is as follows:
fileRecord object is emitting an "error" event without passing an error. This is causing a long chain of code to fail ultimately failing the image resizing job.fileRecord is emitting an undefined error is next upNeed to update dependencies to bring the fix into api-plugin-files and reaction API but running into ES Modules woes and sharp native add-on woes that may necessitate a new node-dev docker image. Onward...
Most helpful comment
OK this is a deep maze to trace through, but so far my analysis is as follows:
fileRecordobject is emitting an"error"event without passing an error. This is causing a long chain of code to fail ultimately failing the image resizing job.fileRecordis emitting an undefined error is next up