Closed na-am closed 2 years ago
@na-am This is happening because the default constructor of the mindconnect agent uses process.cwd()
as the default location, and DietPi is for some reason launching node-red from there. Maybe we should add a configurable location for .mc files in the node in the future.
/**
* Creates an instance of AgentAuth.
* @param {IMindConnectConfiguration} _configuration
* @param {number} [_tokenValidity=600] // this was required in previous versions of the implmentation , kept for compatibility.
* @param {string} [_basePath=process.cwd() + "/.mc/"]
* @memberof AgentAuth
*/
constructor(
configuration: IMindConnectConfiguration,
protected _tokenValidity: number = 600,
basePath: string | IConfigurationStorage = process.cwd() + "/.mc/"
)
I am also experiencing this issue on the IOT2050 Debian Example Image build V01.03.01, please look at #173, I cannot just create the .mc folder at /, because in this build of the IOT2050 Debian image, the root filesystem is read-only of type squashfs
@nehemiascr the device builders really seem to enjoy putting node-red in strange places on strange filesystems ;)
I've seen that you have already found the solution as mentioned here:
https://github.com/mindsphere/node-red-contrib-mindconnect/issues/173#issuecomment-1368633741
We will add a configuration option for the file system location of the .mc directory, however until the setting is added, what you also could do is also just install node-red as a normal application and just run that instead of the pre-installed version of node red. (maybe stop the other one or run this one on a different port so that there is no clash between the instances.)
if Node-red was installed via DietPi Launcher this error appears when deploying Node-red with a MCL node including an IAT: "Error: EACCES: permission denied, mkdir '//.mc/'" so i had to create it by myself:
and it's working as usual
i know, DietPi is using a bit 'strange' directories for the software installed via launcher, but i'm wondering why the MCL node wants to create the directory in "/" because that isn't the home directory of the dietpi user, neither root's home