Closed nrh387 closed 2 years ago
@sn0wcat Could you please kindly help to check that? We are try to use the MindConnect Node-RED Agent v3.12.0 for IDL upload, and it blocked by this issue.
@nrh387 I will add the support in the next version of the library. In the mean time as a workaround, you can use the node just to generate the signed URL (but don't do the upload) and do the actual file upload with standard node-red http nodes , while adding the necessary header. Sorry that i missed that, I don't have access to mindsphere on ALI...
// Uncomment the next code line if you just want to generate an upload url (in msg._signedUrl)
// without actually uploading the file
msg._ignorePayload = true;
Yes, i try to do that, but it looks it hard for me to pass the signed URL to standard node-red http node, the http node not accept the msg.payload from previous node.
@nrh387 I released an alpha version of the libary. Can you manually install the alpha version of the library over the currently installed one with
npm install @mindconnect/mindconnect-nodejs@alpha
in the folder where your nodes are installed. (e.g. in docker it would be /data folder) . The correct folder has flows.json, flows_cred_json etc and check if it is working?
After the installation the package.json in the node_modules/@mindconnect/mindconnect-nodejs folder should have the version 3.19.0-1
@nrh387 any luck?
I have install the alpha version, but it looks still not work for me
from code perspective, it looks ok to check the alibaba gateway address. Is there any debug information could get from node red?
@nrh387 I've just gotten access to a tenant in CN, I have the same behavior, looking into it.
@nrh387 I got it running ;) It was my fault , I told you to install the alpha in the wrong directory, the correct one for hacking the dependency is
It is working now, the example is here:
https://playground.mindconnect.rocks/#flow/5eda11af.df734
I will release a new version some time later today, which should work as expected ;)
@nrh387 the release is out, uninstalling and reinstalling the node so that it picks up the 3.19.0 version of the library should fix the problem.
Yes, i verified and it works. Thanks so much @sn0wcat
@sn0wcat May i know if the latest docker image have been updated for this change or not? Right now, i fixed it with npm install manually. https://hub.docker.com/r/mindconnect/node-red-contrib-mindconnect
Not yet, sorry I forgot to start the docker image build I will take care of it today ...
@sn0wcat that's great, please let me know when the docker image have been pushed to docker hub. Thanks a lot
Describe the bug A clear and concise description of what the bug is. For alibaba cloud mindsphere, upload the file to datelake, the header need add the "Content-Type": "application/octet-stream", this is not need for eu1 and eu2 platform, but that's need for ali platform.
https://github.com/mindsphere/mindconnect-nodejs/blob/master/src/api/sdk/data-lake/data-lake.ts
Suggest add the logic check for alibaba signedURL as below:
public async PutFile(file: string | Buffer, signedUrl: string): Promise {
const myBuffer = typeof file === "string" ? fs.readFileSync(file) : (file as Buffer);