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

sandbox:create returning json multiple times #178

Open
jlbruno opened this issue Sep 3, 2020 · 6 comments
Open

sandbox:create returning json multiple times #178

jlbruno opened this issue Sep 3, 2020 · 6 comments
Labels
bug Something isn't working

Comments

@jlbruno
Copy link
Member

jlbruno commented Sep 3, 2020

Running the sandbox:create command and looking at the json being returned - it seems to be returning the json 3 times for the 1 sandbox creation.

sfcc-ci sandbox:create -r xxxx -t 1 -j -s

Here's what I see returned this morning - edited to remove realm data and sb id, but the sb ID was the same.


{"message":"Creation of new sandbox 002 for realm xxxx finished (300504 ms). Sandbox id is f91f5ccd-036c-4969-9a91-11118ca78e11, status of sandbox is started. You may use `sfcc-ci sandbox:list` to check the status of the sandbox.","sandbox":{"id":"f91f5ccd-036c-4969-9a91-11111ca78e11","realm":"xxxx","instance":"002","versions":{"app":"20.9.1.23","web":"20.2.1.0"},"state":"started","createdAt":"2020-09-03T13:25:33Z","eol":"2020-09-03T14:25:22Z","links":{"bm":"https://xxxx-002.sandbox.us01.dx.commercecloud.salesforce.com/on/demandware.store/Sites-Site","ocapi":"https://xxxx-002.sandbox.us01.dx.commercecloud.salesforce.com/s/-/dw/data/","impex":"https://xxxx-002.sandbox.us01.dx.commercecloud.salesforce.com/on/demandware.servlet/webdav/Sites/Impex","code":"https://xxxx-002.sandbox.us01.dx.commercecloud.salesforce.com/on/demandware.servlet/webdav/Sites/Cartridges","logs":"https://xxxx-002.sandbox.us01.dx.commercecloud.salesforce.com/on/demandware.servlet/webdav/Sites/Logs"}},"instance":{"host":"xxxx-002.sandbox.us01.dx.commercecloud.salesforce.com","alias":"xxxx-002","default":true}}
{"message":"Creation of new sandbox 002 for realm xxxx finished (305498 ms). Sandbox id is f91f5ccd-036c-4969-9a91-11118ca78e11, status of sandbox is started. You may use `sfcc-ci sandbox:list` to check the status of the sandbox.","sandbox":{"id":"f91f5ccd-036c-4969-9a91-11111ca78e11","realm":"xxxx","instance":"002","versions":{"app":"20.9.1.23","web":"20.2.1.0"},"state":"started","createdAt":"2020-09-03T13:25:33Z","eol":"2020-09-03T14:25:22Z","links":{"bm":"https://xxxx-002.sandbox.us01.dx.commercecloud.salesforce.com/on/demandware.store/Sites-Site","ocapi":"https://xxxx-002.sandbox.us01.dx.commercecloud.salesforce.com/s/-/dw/data/","impex":"https://xxxx-002.sandbox.us01.dx.commercecloud.salesforce.com/on/demandware.servlet/webdav/Sites/Impex","code":"https://xxxx-002.sandbox.us01.dx.commercecloud.salesforce.com/on/demandware.servlet/webdav/Sites/Cartridges","logs":"https://xxxx-002.sandbox.us01.dx.commercecloud.salesforce.com/on/demandware.servlet/webdav/Sites/Logs"}},"instance":{"host":"xxxx-002.sandbox.us01.dx.commercecloud.salesforce.com","alias":"xxxx-002","default":true}}
@astound-ci
Copy link

@tobiaslohr same behaviour here...
--sync option passed cause resulting JSON output to be invalid.

@wundrian
Copy link
Contributor

wundrian commented Sep 4, 2020

Does this also happen without the --json option set? I'm looking at the code, but the loop's pretty solid and hasn't changed in months. I'm a bit irritated why this would start now.

@astound-ci
Copy link

@wundrian , yes it happens always whenever --sync option passed.
./sfcc-ci-macos sandbox:create --sync --realm zzrk --ttl 1 Creation of new sandbox 009 for realm zzrk finished (288037 ms). Sandbox id is b56049c6-4745-4abc-9fa3-a74d9acf9481, status of sandbox is started. You may use sfcc-ci sandbox:listto check the status of the sandbox. Creation of new sandbox 009 for realm zzrk finished (288236 ms). Sandbox id is b56049c6-4745-4abc-9fa3-a74d9acf9481, status of sandbox is started. You may usesfcc-ci sandbox:listto check the status of the sandbox. Creation of new sandbox 009 for realm zzrk finished (298174 ms). Sandbox id is b56049c6-4745-4abc-9fa3-a74d9acf9481, status of sandbox is started. You may usesfcc-ci sandbox:list to check the status of the sandbox.

@EvilJordan
Copy link
Contributor

The easiest solution, since I assume you're piping it through jq is to "slurp" all responses into an array, then process only the first element:

... | jq -s '.[0].key'
-s is for slurp

@tobiaslohr
Copy link
Contributor

@jlbruno @astound-ci Is this issue still existing?

@tobiaslohr tobiaslohr added the bug Something isn't working label Jul 5, 2021
@jlbruno
Copy link
Member Author

jlbruno commented Aug 11, 2021

@tobiaslohr I unfortunately am not able to test this at this time. @astound-ci can you help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants