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

[Not able to use sudo sfdx sgd:source:delta --to HEAD --from HEAD^] #907

Closed
1 task
agam-sharma opened this issue Sep 2, 2024 · 24 comments
Closed
1 task
Assignees
Labels
bug Something isn't working

Comments

@agam-sharma
Copy link

Issue verification check:

  • is the current repository fully deployable at the commit SHA provided with the 'from' parameter of the command?

What is the problem?

I am not able to run sudo sfdx sgd:source:delta --to HEAD --from HEAD^ command. Getting the following error.

{
"error": "Cannot read properties of null (reading 'slice')",
"output": ".",
"success": false,
"warnings": []
}


What is the parameter and the value you used with it?

What is the expected result?

What is the actual result?

Steps to reproduce


Execution context


Operating System:

yarn version:

node version:

git version:

sfdx version:

sgd plugin version:

More information (optional)


@agam-sharma agam-sharma added the bug Something isn't working label Sep 2, 2024
@scolladon
Copy link
Owner

Hi @agam-sharma!

Thanks for raising this issue and thanks for contributing in making this project better!

Does the plugin execute correctly when not using sudo ?
Why do you need to use sudo ? I'm curious because it should be required to use sudo to execute the plugin

@agam-sharma
Copy link
Author

agam-sharma commented Sep 2, 2024

Hi @scolladon

Without sudo , command was failing .. that was probably because it was try to save sf.log file.
but strangely when I used sudo then I got the above mentioned error in an object format.

I have same thing configured in my git workflow where I use sgd to deploy delta package and it works there not sure why isn’t it working on my local.

@scolladon
Copy link
Owner

scolladon commented Sep 2, 2024

I think you should own the sf.log file located inside your user folder
Could you ensure you are the owner and try again to run the plugin without sudo ?

sudo chown <you_user> /Users/<you_user>/.sf/sf.log
sfdx sgd:source:delta --to HEAD --from HEAD^

@agam-sharma
Copy link
Author

Hi @scolladon

I changed the owner of that folder to my self , still I am getting the same error.

sfdx sgd:source:delta --to HEAD --from HEAD^ --output .

{
"error": "Cannot read properties of null (reading 'slice')",
"output": ".",
"success": false,
"warnings": []
}

Not able to debug the root cause either.

@scolladon
Copy link
Owner

It seems to be similar to #862
Could you give me access to this repository so I can reproduce locally myself please ?
Also, give more detail about the execution context please (uname -v ; yarn -v ; node -v ; git --version ; sfdx --version ; sfdx plugins)

@agam-sharma
Copy link
Author

The repo I am working on is my work repo .
uname -v
Darwin Kernel Version 23.5.0: Wed May 1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000

node -v
v22.7.0

git --version
git version 2.39.1

sfdx --version
@salesforce/cli/2.56.7 darwin-arm64 node-v22.7.0

sfdx plugins
sfdx sgd

@scolladon
Copy link
Owner

Could you give me access? I can sign a NDA

@agam-sharma
Copy link
Author

Hi @scolladon

Unfortunately , that won't be possible for me . Additionally Repos and releases are taken care by our platform and release team.

@scolladon
Copy link
Owner

Could you create a reproduction environment forking our reproduction playground and give me access ?

@agam-sharma
Copy link
Author

Hi @scolladon ,
Are you suggesting , just fork the reproduction repo and give access to you. ?

@agam-sharma
Copy link
Author

@scolladon
Copy link
Owner

How can I reproduce the issue with your playground ?
What command should I execute and on which branch have you setup the reproduction context ?

@thephani
Copy link

thephani commented Sep 4, 2024

@agam-sharma Even though it's throwing an error, I can see that the package.xml has been generated successfully. Can you verify if it's the same with you?
@scolladon FYI

@agam-sharma
Copy link
Author

Hi @thephani

Did you get the same error and yet the package was created ?

@agam-sharma
Copy link
Author

HI @scolladon
I tried it in my personal machine , and it worked fine. Although below error came . But Package got generated
{
"error": null,
"output": ".",
"success": true,
"warnings": []
}

On the contrary , same command is throwing error for my work repository.
The common thing I can see is , it throws error at "output": "." but in case of my work repo , in "error" in get : Cannot read properties of null (reading slice).

Bit strange but this what I was able to deduce.

@scolladon
Copy link
Owner

Hi @agam-sharma

Thanks for those information.

As the plugin is working fine, I think the issue is observable only under very specific condition/context that your work repository have.
To help me fixing this very specific edge case I want to be able to also observe the problem and so I need to be able to reproduce the issue.
This is why I asked you to recreate the condition of observation of the problem using our reproduction playground (as I cannot access your work repository).

Could you provide a way for me to reproduce the issue please (accessing your repo, or providing the minimal context required to reproduce inside a dedicated branch of the reproduction playground) ?

@thephani
Copy link

thephani commented Sep 5, 2024

Hi @thephani

Did you get the same error and yet the package was created ?

Yes, thats correct!

@scolladon
Copy link
Owner

Is there a way for me to reproduce the issue on my end ? So I can debug

@thephani
Copy link

thephani commented Sep 6, 2024

@scolladon Here are steps I created.

  1. Create a project with manifest [added only few metadata like apexclass, triggers, flows only]
  2. copy folder structure to repo
  3. run sf sgd source delta command to reproduce error

@scolladon
Copy link
Owner

I do not reproduce by doing it, as you can see our CI test our end2end repository against multiple architectures without the issue.

I think it is more related to the content of your repository, this is why I'd like to access it or, if you can isolate the problem on your side and put it in the reproduction playground.

In the meantime, do you have the same issue with the stable channel ? (´sf plugins install sfdx-git-delta@stable´)

@agam-sharma
Copy link
Author

Hi @scolladon

'sf plugins install sfdx-git-delta@stable' worked perfectly. Although I got this error
{
"error": null,
"output": ".",
"success": true,
"warnings": []
}

but Package xml were generated.
What's the difference in @stable

** I'll try to mock my repo into the playground org.

@scolladon
Copy link
Owner

scolladon commented Sep 6, 2024

Although I got this error

Which error ?

What's the difference in https://github.com/stable

The underlying library to interact with git is different, in stable it was in house library, after that it is an external fast portable library

** I'll try to mock my repo into the playground org.

Thanks a lot 🙏

@agam-sharma
Copy link
Author

agam-sharma commented Sep 9, 2024

Although I got this error

Which error ?

Oh Sorry My bad , I thought it was an error.
{
"error": null,
"output": ".",
"success": true,
"warnings": []
}

Although its not.

I'll try to mock my repo into the playground org.

I feel that the problem is with repo structure of my org , I'll provide a SS of repo struct.

@agam-sharma
Copy link
Author

agam-sharma commented Sep 12, 2024

Hi @scolladon

I downloaded my work repository again , and it is now working perfectly fine.

Thanks

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

3 participants