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

DietPi 8.1.2, Node-red 2.2.2 #150

Closed
na-am opened this issue Feb 22, 2022 · 3 comments
Closed

DietPi 8.1.2, Node-red 2.2.2 #150

na-am opened this issue Feb 22, 2022 · 3 comments
Labels
wontfix This will not be worked on

Comments

@na-am
Copy link

na-am commented Feb 22, 2022

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:

sudo mkdir /.mc
sudo chown nodered:nodered /.mc

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

@sn0wcat
Copy link
Member

sn0wcat commented Feb 22, 2022

@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.

https://github.com/mindsphere/mindconnect-nodejs/blob/105ed883166619cbf12cc77f96e501736752b9e9/src/api/agent-auth.ts#L537

/**
     * 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/"
    ) 

@nehemiascr
Copy link

nehemiascr commented Jan 2, 2023

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

@sn0wcat
Copy link
Member

sn0wcat commented Jan 3, 2023

@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:

#173 (comment)

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.)

https://nodered.org/docs/getting-started/local

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants