Skip to main content
Question

Cannot set property 'privateKey' of undefined

  • May 22, 2025
  • 10 replies
  • 10 views

Forum|alt.badge.img

BOX_NSYG0gNtLMyZDNop__fmzA.pngI use the commend box folders:get 0 -v
I got this error, but the private.pem exists in the path.
Can you help me with the issue?

10 replies

Forum|alt.badge.img

Hi there, what operating system are you on? If you are on linux/mac then the pem might not have the right permissions to be read.


Forum|alt.badge.img

Thanks.

I have set the permission with chmod -R 777 . There is still this mistake.
Set the cli comment is  box configure:environments:add ./455328__config.json --private-key-path /Users/liuhl/Desktop/test/backuptest/private.pem

private.pem was created by the bellow comments.

openssl genrsa -des3 -out private.pem 2048
openssl rsa -in private.pem -outform PEM -pubout -out public.pem

455328__config.json like below. BOX_rnJ1Gk_zDCSiWjMTwJrKCw.png


Forum|alt.badge.img

And you are still getting the same error?


Forum|alt.badge.img

Yes There is still the same error.

My computer is mac.


Forum|alt.badge.img

I am running into the same issue. Let me check with the CLI team.


Forum|alt.badge.img

I think I found out the issue, it's a bug with our CLI. I have reported the issue and a fix.

https://github.com/box/boxcli/issues/207

https://github.com/box/boxcli/pull/206

Meanwhile, the way forward is to copy your PEM into the config.json file, removing any new lines. We hope to have a new release out asap.


Forum|alt.badge.img

Thank you very much.


Forum|alt.badge.img

So we discovered this was a bug. I have submitted a patch and am now waiting for them to merge this patch and release a new version of the CLI.

https://github.com/box/boxcli/pull/206


Forum|alt.badge.img

Thanks.
I have fix the issue on my local with the code of https://github.com/box/boxcli/pull/206/files


Forum|alt.badge.img

Excellent!