keirbowden / bbsfdx

Bob Buzzard Utilities Salesforce CLI Plugin
7 stars 1 forks source link

Add IP Ranges not working #11

Open gitmevg opened 2 years ago

gitmevg commented 2 years ago

Hello,

Getting following error while trying to use the plugin

PS PATH\gitmevg> sfdx bb:iprange:add -r 0.0.0.0:255.255.255.255 -u gitmevg_so1 Pending sleeping for 5 seconds ERROR running bb:iprange:add: ENOENT: no such file or directory, mkdir '/tmp/bbsfdx_2021122014333633'

keirbowden commented 2 years ago

Hello - that looks like the tmp directory doesn't exist. What operating system are you running on?

gitmevg commented 2 years ago

I am working on Windows, but I tried via GITBASH as well...

/tmp exists there on navigating

**Username@MACHINENAME MINGW64 /d/projects/vscode/gitmevg $ sfdx bb:iprange:add -r 0.0.0.0:255.255.255.255 -u gitmevg_so2 ERROR running bb:iprange:add: ENOENT: no such file or directory, mkdir '/tmp/bbsfdx_2021122014431016'

Username@MACHINENAME MINGW64 /d/projects/vscode/gitmevg $ cd /tmp**

Username@MACHINENAME MINGW64 /tmp

keirbowden commented 2 years ago

I don't think I've ever used that command on windows, and looking at the code I can see that it might have problems creating a temporary directory outside of Linux OS or similar. I'll test it on my windows machine and see if I can reproduce the issue.

gitmevg commented 2 years ago

I just tried and it failed on Debian Conatiner Image for SFDX as well for the IP range (no logs):

root@somenumber:/app/MyProject# sfdx bb:iprange:add -r 0.0.0.0:255.255.255.255 -u XXXXXXXXX@example.com Deploying Add IP range Failed

root@somenumber:/app/MyProject# sfdx bb:iprange:add -r X.X.X.X -u XXXXXXX@example.com Deploying Add IP range Failed

gitmevg commented 2 years ago

My immediate Problem got resolved with the powerkit plugin:

root@somenumber:/app/MyProject# sfdx plugins | grep power sfpowerkit 4.0.1 root@somenumber:/app/MyProject#

**root@somenumber:/app/MyProject# sfdx sfpowerkit:org:relaxiprange -u gitmevg_so --all

sfpowerkit -- The DX@Scale Developer Toolkit -Version:4.0.1 -Release:December 21

INFO [2021-12-21 06:45:05.867 +0000] (sfpowerkit): Ip range to set : 0.0.0.0-255.255.255.255 INFO [2021-12-21 06:45:07.582 +0000] (sfpowerkit): Polling for Deployment Status INFO [2021-12-21 06:45:13.736 +0000] (sfpowerkit): Ip range is successfully set in XXXXXXXXXX@example.com**

keirbowden commented 2 years ago

Morning,

Good to hear you got your problem resolved.

Thanks for raising the issue - there were actually a couple of problems here:

  1. The plug-in relied on a /tmp directory being present - this was the first error you reported. Now it creates a temporary directory below the directory that you are running the command in, and removes it after the command completes.
  2. A couple of security settings have been removed in API 51, and when retrieving them in earlier API versions the value comes back as an XML attribute. That gets lost in the parsing that I carry out, so resulted in invalid XML being deployed, leading to the error that you were seeing in Debian. I've upgraded the plug-in to use the latest API (53).

I've pushed a new version of my plug-in that fixes both of these and tested on MacOS and Windows 11. While I understand that you don't need to run this any more, if you have time to run a quick test and let me know if you see any errors, that would be much appreciated - let me know either way so I can close this issue.

You can upgrade to the latest version using sfdx plugins:update

gitmevg commented 2 years ago

Still failing:

root@somenumber:/app/MyProject# sfdx plugins @salesforce/sfdx-scanner 2.12.0 bbsfdx 1.4.2 sfpowerkit 4.0.1 root@somenumber:/app/MyProject# sfdx bb:iprange:add -r 0.0.0.0:255.255.255.255 -u XXXXXX@example.com Deploying InProgress sleeping for 5 seconds Add IP range Failed root@somenumber:/app/MyProject# uname -a Linux a1de50a2151f 5.10.47-linuxkit #1 SMP Sat Jul 3 21:51:47 UTC 2021 x86_64 GNU/Linux root@somenumber:/app/MyProject#

keirbowden commented 2 years ago

When you execute the command, this carries out a retrieve and a deployment, and it looks like the deploy is failing. Can you have a look at the deployment status page and see what error you are getting?