sfdx-git-delta icon indicating copy to clipboard operation
sfdx-git-delta copied to clipboard

Getting `Could not find` error when generating delta source

Open kez-sophos opened this issue 1 year ago • 10 comments

Issue verification check:

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

What is the problem?


We are getting an error when trying to generate delta source with sfdx-git-delta versions above 5.34.0.

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

sgd source delta --to HEAD --from stash/master --source C:<REPO_PATH> --api-version 59.0 --output C:<REPO_PATH>\delta-src/ --generate-delta

What is the expected result?

Delta source generation succeeds.

What is the actual result?

Delta source generation fails. Json Response: {"success":false,"error":"Could not find b2c43ed8d669af3b0af194a54362238c0ed66de5.","output":"C:\<REPO_PATH>\delta-src/","warnings":[]}

Steps to reproduce


We are unable to reproduce the issue locally (within our machines) the issue is occurring within our build servers.

Execution context


Within our build servers we use Bamboo and Windows 2012. Operating System: Windows 2012

yarn version: N/A

node version: v18.12.0

git version: git version 2.29.2.windows.3

sfdx version: @salesforce/cli/2.40.7 win32-x64 node-v20.12.2

sgd plugin version: sfdx-git-delta 5.39.2 (5.39.2)

kez-sophos avatar May 14 '24 17:05 kez-sophos

To clarify, sfdx-git-delta version 2.34.0 works as expected for us. We encounter this issue with later versions.

kez-sophos avatar May 14 '24 18:05 kez-sophos

Hi @kez-sophos !

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

We are aware of this issue already, it has been discovered with the #762 But we are not able to reproduce it locally so we cannot fix it yet. I tried a lot of things (VM, etc) without success.

You are right, the issue is not there with the v5.34.0 (current stable channel) because after this point we have refactored the way we interact with git. After that point we are using isomorphic-git to abstract and speed up the interaction with git. Unfortunately it has some issues with windows, especially with very large and aged repository...

Do you have a way to reproduce the issue I could use with a VM ?

scolladon avatar May 14 '24 18:05 scolladon

Hi @kez-sophos, do you have any way to help me reproduce the issue ?

scolladon avatar May 28 '24 17:05 scolladon

Hi @kez-sophos I need your help to reproduce please, could you send us the minimal steps to follow to reproduce it please ?

scolladon avatar Jun 04 '24 12:06 scolladon

we also get the issue with sfdx-git-delte version 5.42.0 on our build servers and if we downgrade to the vertion 5.43.0 then the package creation is working again but with the older API version 59.0

OS: MS Windows Server 2019 node version: 20.11.1 git vertion: git version 2.44.0.windows.1 sf version: @salesforce/cli/2.53.6 win32-x64 node-v20.11.1

on my local machine Windows 11 and pretty similar versoins the issue is not appearing

any ideas what could be the cause of the problem?

ALesc21 avatar Aug 14 '24 13:08 ALesc21

Thanks for those information. It really helps

What api version are you using ? 61 ? And what version of sgd is working ? (5.43.0 does not exist yet)

scolladon avatar Aug 14 '24 14:08 scolladon

hi @scolladon,

we try or have to use the api vesion 61 because some implementations already requires it.

sorry that was a number mix-up. So the sgd version 5.42.0 is not working then we downgraded to 5.34.0 like "[kez-sophos]" wrote and it start to work without issue

ALesc21 avatar Aug 15 '24 05:08 ALesc21

This issue is very hard because it is windows dependent and also requires a very big project. If you can give me access to your project where you reproduce the issue it will greatly help reproducing and see what happens. I suspect the issue comes from a library we are using that need to be patched, but no customers so far have been able to provide a complete reproduction scenario working on my machine 😪 I can sign NDA, or anything if necessary

scolladon avatar Aug 15 '24 10:08 scolladon

hi @scolladon, I will not be available for some days but afterwards maybe we can plan a session for screen sharing and check together.

ALesc21 avatar Aug 15 '24 12:08 ALesc21

That's nice of you @ALesc21 to give a bit of your time but it is very hard to investigate with a screen share and a limited amount of time. We tried already with another person and we did not manage to find the root cause. I would really feel more confident if I can reproduce the issue on my laptop

scolladon avatar Aug 15 '24 13:08 scolladon

HI @scolladon like I wrote you in the email it make sense to look in our environment because the execution on my personal client is working and just on the Windows Servers the issue is happening.

ALesc21 avatar Oct 23 '24 14:10 ALesc21

HI @scolladon like I wrote you in the email it make sense to look in our environment because the execution on my personal client is working and just on the Windows Servers the issue is happening.

Do you know if it is possible to debug in your environment ? Or do you know how I could reproduce the issue so I can debug ? (Maybe create a virtual machine and use your repository, etc)

scolladon avatar Oct 23 '24 15:10 scolladon

I have full access on this servers so we can do what ever it needs. If you have some ideas what I have to set then let me know.

For reproducing you need the windows server + the installed tools such: git, node, sf and sfdx-git-delta. On this server I run the command "sf sgd:source:delta --to HEAD --from HEAD^ --output " and with the versions higher than 5.34.0 I receive the following outcome (in this case I tryed to install the newest sfdx-git-delta version 5.49):

C:\BuildAgent01\work\86775e496ec9c505>sf sgd:source:delta --to HEAD --from HEAD^ --output deployment/ONECRM-0000 (node:9488) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead. (Use node --trace-deprecation ... to show where the warning was created) (node:9488) Warning: Deprecated config name: apiVersion. Please use org-api-version instead. { "error": "Could not find 9746fb6b644a0a615e7de4902ed68c916e551f2f.", "output": "deployment/ONECRM-0000", "success": false, "warnings": [ "[INFORMATION] sfdx-git-delta v6 is coming soon! Read more and plan your migration: https://github.com/scolladon/sfdx-git-delta/issues/936" ] }

So maybe you find time for screensharing and we are going through and compare.

ALesc21 avatar Oct 24 '24 05:10 ALesc21

Ok @ALesc21, let's setup a screen share. But first you'll need to setup the windows server so we can debug and extract the most of this session.

What I want is to be able to debug the code. So you need to clone this repository and set it up for debug Make sure you have git bash and chrome installed on this server.

cd <folder of your choice>
git clone [email protected]:scolladon/sfdx-git-delta.git
cd sfdx-git-delta
yarn
yarn pack
mkdir output
node --inspect-brk ./bin/run -f HEAD~1 -d
# it should wait for the debugger to be attached, open chrome and the developer console and click on the node icon on the left.

If you get this far then it will be easier to understand what is happening in this case. And from here we will be able to setup a screen share :)

Let me know when ready !

scolladon avatar Oct 24 '24 09:10 scolladon

Sounds great @scolladon I will prepare it and let you know. Just to be 100 % sure I would like know if we need the internet access or something else because the servers are behind the firewall and has restricted access to specific sites and downloads.

ALesc21 avatar Oct 24 '24 12:10 ALesc21

Internet access is necessary only to clone the repository @ALesc21. If it is not possible to clone but you can pass files to the server then we will clone on your machine and pass the repo to the server via your machine

Then we just need to be able to access the virtual machine and run the code.

scolladon avatar Oct 24 '24 13:10 scolladon

I am getting similar error with version 5.49.1

error	04-Nov-2024 17:56:35	(node:9680) Warning: Deprecated config name: apiVersion. Please use org-api-version instead.
error	04-Nov-2024 17:56:35	(Use `node --trace-warnings ...` to show where the warning was created)
build	04-Nov-2024 17:56:35	{
build	04-Nov-2024 17:56:35	  "error": "Could not find d11e5347d09f3b50be5d8556b5213589bfa21bf0.",
build	04-Nov-2024 17:56:35	  "output": ".",
build	04-Nov-2024 17:56:35	  "success": false,
build	04-Nov-2024 17:56:35	  "warnings": [
build	04-Nov-2024 17:56:35	    "[INFORMATION] sfdx-git-delta v6 is coming soon! Read more and plan your migration: https://github.com/scolladon/sfdx-git-delta/issues/936"
build	04-Nov-2024 17:56:35	  ]
build	04-Nov-2024 17:56:35	}

dsweetmanusda avatar Nov 04 '24 20:11 dsweetmanusda

I am getting similar error with version v5.49.1

What is the environment you are running in ? (Mac / Windows ? Node version ? Git version ?) Could you help me reproduce the issue by giving me access to the repository ? (I can sign NDA)

scolladon avatar Nov 04 '24 20:11 scolladon

the environment is run by another organization, I am "just" a user. Running on Linux. sfdx-cli/7.209.6 linux-x64 node-v18.20.4 sfdx-git-delta 5.49.1

dsweetmanusda avatar Nov 04 '24 21:11 dsweetmanusda

git version 2.43.5

dsweetmanusda avatar Nov 04 '24 21:11 dsweetmanusda

Could you give me access to the repository ? And how to reproduce the issue please

scolladon avatar Nov 04 '24 21:11 scolladon

The repository is a USDA repository run on site, I cannot give access. the error is thrown when the Bamboo script executes: sfdx sgd:source:delta --ignore .forceignore --to "origin/$sourceBranch" --from $(git merge-base "origin/$sourceBranch" "origin/$targetBranch") --output .

dsweetmanusda avatar Nov 04 '24 21:11 dsweetmanusda

Coud you isolate the issue in our sfdx-git-delta-reproduction-playground ? The issue emerges from the content of the repository it seems

scolladon avatar Nov 04 '24 21:11 scolladon

We just today upgrade from sfdx-git-delta 5.13.3 (5.13.3) which successfully created the manifest files, the problem was it only supported up to version 57.

dsweetmanusda avatar Nov 04 '24 21:11 dsweetmanusda

How do I do that?

dsweetmanusda avatar Nov 04 '24 21:11 dsweetmanusda

I'm looking for a way to reproduce this issue and so being able to debug the problem. I currently am not able to do so, so I'm not able to identify the root cause of this issue. Having access to the repository would probably give me the capacity to reproduce the issue easily. I can sign any document you need.

How do I do that?

You can fork the reproduction playground, create a branch, and apply the minimal metadata necessary to reproduce the issue. Give me access to the fork and let me know what command to run (with which parameters).

We just today upgrade from sfdx-git-delta 5.13.3 (5.13.3) which successfully created the manifest files, the problem was it only supported up to version 57.

You can upgrade to the stable channel (5.34.0). It is known to not have this issue while being more up to date than the 5.13.3.

scolladon avatar Nov 04 '24 21:11 scolladon

HI @scolladon, based on some firewall restrictions on the server I cloned the repo on my client and moved them to the server.

After that I followed the steps which you provided previously and that is the output in the bash terminal:

DEBIE1TC_SFDX@MSE-SVCRM01 MINGW64 /c/temp/troubleshooting/sfdx-git-delta (main)
$ yarn
➤ YN0000: ┌ Resolution step
➤ YN0002: │ @commitlint/load@npm:19.4.0 doesn't provide @types/node (p562fb), requested by cosmiconfig-typescript-loader
➤ YN0002: │ @commitlint/load@npm:19.4.0 doesn't provide typescript (p1b026), requested by cosmiconfig-typescript-loader
➤ YN0002: │ @oclif/core@npm:2.16.0 doesn't provide @types/node (p7022c), requested by ts-node
➤ YN0002: │ @oclif/core@npm:2.16.0 doesn't provide typescript (p85a5c), requested by ts-node
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is t
he six-letter p-prefixed code
➤ YN0000: └ Completed in 0s 209ms
➤ YN0000: ┌ Fetch step
➤ YN0013: │ yoctocolors-cjs@npm:2.1.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ yoctocolors@npm:2.1.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ zip-stream@npm:4.1.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ zod-validation-error@npm:3.3.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ zod@npm:3.23.8 can't be found in the cache and will be fetched from the remote registry
➤ YN0000: └ Completed in 7s 318ms
➤ YN0000: ┌ Link step
➤ YN0007: │ @biomejs/biome@npm:1.8.3 must be built because it never has been before or the last one failed
➤ YN0007: │ @swc/core@npm:1.7.23 [928f4] must be built because it never has been before or the last one failed
➤ YN0007: │ dtrace-provider@npm:0.6.0 must be built because it never has been before or the last one failed
➤ YN0007: │ core-js@npm:3.37.1 must be built because it never has been before or the last one failed
➤ YN0007: │ core-js-pure@npm:3.37.1 must be built because it never has been before or the last one failed
➤ YN0000: └ Completed in 3m 3s
➤ YN0000: Done with warnings in 3m 10s

DEBIE1TC_SFDX@MSE-SVCRM01 MINGW64 /c/temp/troubleshooting/sfdx-git-delta (main)
$ yarn pack
➤ YN0036: Calling the "prepack" lifecycle script
➤ YN0000: CHANGELOG.md
➤ YN0000: LICENSE.md
➤ YN0000: README.md
➤ YN0000: bin/dev
➤ YN0000: bin/dev.cmd
➤ YN0000: bin/run
➤ YN0000: bin/run.cmd
➤ YN0000: lib/adapter/GitAdapter.d.ts
➤ YN0000: lib/adapter/GitAdapter.js
➤ YN0000: lib/adapter/GitAdapter.js.map
➤ YN0000: lib/commands/sgd/source/delta.d.ts
➤ YN0000: lib/commands/sgd/source/delta.js
➤ YN0000: lib/commands/sgd/source/delta.js.map
➤ YN0000: lib/constant/fsConstants.d.ts
➤ YN0000: lib/constant/fsConstants.js
➤ YN0000: lib/constant/fsConstants.js.map
➤ YN0000: lib/constant/gitConstants.d.ts
➤ YN0000: lib/constant/gitConstants.js
➤ YN0000: lib/constant/gitConstants.js.map
➤ YN0000: lib/constant/metadataConstants.d.ts
➤ YN0000: lib/constant/metadataConstants.js
➤ YN0000: lib/constant/metadataConstants.js.map
➤ YN0000: lib/locales/en.d.ts
➤ YN0000: lib/locales/en.js
➤ YN0000: lib/locales/en.js.map
➤ YN0000: lib/main.d.ts
➤ YN0000: lib/main.js
➤ YN0000: lib/main.js.map
➤ YN0000: lib/metadata/MetadataRepository.d.ts
➤ YN0000: lib/metadata/MetadataRepository.js
➤ YN0000: lib/metadata/MetadataRepository.js.map
➤ YN0000: lib/metadata/MetadataRepositoryImpl.d.ts
➤ YN0000: lib/metadata/MetadataRepositoryImpl.js
➤ YN0000: lib/metadata/MetadataRepositoryImpl.js.map
➤ YN0000: lib/metadata/a48.json
➤ YN0000: lib/metadata/metadataManager.d.ts
➤ YN0000: lib/metadata/metadataManager.js
➤ YN0000: lib/metadata/metadataManager.js.map
➤ YN0000: lib/metadata/v46.json
➤ YN0000: lib/metadata/v47.json
➤ YN0000: lib/metadata/v49.json
➤ YN0000: lib/metadata/v50.json
➤ YN0000: lib/metadata/v51.json
➤ YN0000: lib/metadata/v52.json
➤ YN0000: lib/metadata/v53.json
➤ YN0000: lib/metadata/v54.json
➤ YN0000: lib/metadata/v55.json
➤ YN0000: lib/metadata/v56.json
➤ YN0000: lib/metadata/v57.json
➤ YN0000: lib/metadata/v58.json
➤ YN0000: lib/metadata/v59.json
➤ YN0000: lib/metadata/v60.json
➤ YN0000: lib/metadata/v61.json
➤ YN0000: lib/metadata/v62.json
➤ YN0000: lib/post-processor/baseProcessor.d.ts
➤ YN0000: lib/post-processor/baseProcessor.js
➤ YN0000: lib/post-processor/baseProcessor.js.map
➤ YN0000: lib/post-processor/flowTranslationProcessor.d.ts
➤ YN0000: lib/post-processor/flowTranslationProcessor.js
➤ YN0000: lib/post-processor/flowTranslationProcessor.js.map
➤ YN0000: lib/post-processor/includeProcessor.d.ts
➤ YN0000: lib/post-processor/includeProcessor.js
➤ YN0000: lib/post-processor/includeProcessor.js.map
➤ YN0000: lib/post-processor/packageGenerator.d.ts
➤ YN0000: lib/post-processor/packageGenerator.js
➤ YN0000: lib/post-processor/packageGenerator.js.map
➤ YN0000: lib/post-processor/postProcessorManager.d.ts
➤ YN0000: lib/post-processor/postProcessorManager.js
➤ YN0000: lib/post-processor/postProcessorManager.js.map
➤ YN0000: lib/service/botHandler.d.ts
➤ YN0000: lib/service/botHandler.js
➤ YN0000: lib/service/botHandler.js.map
➤ YN0000: lib/service/customFieldHandler.d.ts
➤ YN0000: lib/service/customFieldHandler.js
➤ YN0000: lib/service/customFieldHandler.js.map
➤ YN0000: lib/service/customLabelHandler.d.ts
➤ YN0000: lib/service/customLabelHandler.js
➤ YN0000: lib/service/customLabelHandler.js.map
➤ YN0000: lib/service/customObjectHandler.d.ts
➤ YN0000: lib/service/customObjectHandler.js
➤ YN0000: lib/service/customObjectHandler.js.map
➤ YN0000: lib/service/decomposedHandler.d.ts
➤ YN0000: lib/service/decomposedHandler.js
➤ YN0000: lib/service/decomposedHandler.js.map
➤ YN0000: lib/service/diffLineInterpreter.d.ts
➤ YN0000: lib/service/diffLineInterpreter.js
➤ YN0000: lib/service/diffLineInterpreter.js.map
➤ YN0000: lib/service/flowHandler.d.ts
➤ YN0000: lib/service/flowHandler.js
➤ YN0000: lib/service/flowHandler.js.map
➤ YN0000: lib/service/inBundleHandler.d.ts
➤ YN0000: lib/service/inBundleHandler.js
➤ YN0000: lib/service/inBundleHandler.js.map
➤ YN0000: lib/service/inFileHandler.d.ts
➤ YN0000: lib/service/inFileHandler.js
➤ YN0000: lib/service/inFileHandler.js.map
➤ YN0000: lib/service/inFolderHandler.d.ts
➤ YN0000: lib/service/inFolderHandler.js
➤ YN0000: lib/service/inFolderHandler.js.map
➤ YN0000: lib/service/inResourceHandler.d.ts
➤ YN0000: lib/service/inResourceHandler.js
➤ YN0000: lib/service/inResourceHandler.js.map
➤ YN0000: lib/service/lwcHandler.d.ts
➤ YN0000: lib/service/lwcHandler.js
➤ YN0000: lib/service/lwcHandler.js.map
➤ YN0000: lib/service/objectTranslationHandler.d.ts
➤ YN0000: lib/service/objectTranslationHandler.js
➤ YN0000: lib/service/objectTranslationHandler.js.map
➤ YN0000: lib/service/sharedFolderHandler.d.ts
➤ YN0000: lib/service/sharedFolderHandler.js
➤ YN0000: lib/service/sharedFolderHandler.js.map
➤ YN0000: lib/service/standardHandler.d.ts
➤ YN0000: lib/service/standardHandler.js
➤ YN0000: lib/service/standardHandler.js.map
➤ YN0000: lib/service/typeHandlerFactory.d.ts
➤ YN0000: lib/service/typeHandlerFactory.js
➤ YN0000: lib/service/typeHandlerFactory.js.map
➤ YN0000: lib/tsconfig.tsbuildinfo
➤ YN0000: lib/types/config.d.ts
➤ YN0000: lib/types/config.js
➤ YN0000: lib/types/config.js.map
➤ YN0000: lib/types/git.d.ts
➤ YN0000: lib/types/git.js
➤ YN0000: lib/types/git.js.map
➤ YN0000: lib/types/metadata.d.ts
➤ YN0000: lib/types/metadata.js
➤ YN0000: lib/types/metadata.js.map
➤ YN0000: lib/types/output.d.ts
➤ YN0000: lib/types/output.js
➤ YN0000: lib/types/output.js.map
➤ YN0000: lib/types/work.d.ts
➤ YN0000: lib/types/work.js
➤ YN0000: lib/types/work.js.map
➤ YN0000: lib/utils/asyncFilter.d.ts
➤ YN0000: lib/utils/asyncFilter.js
➤ YN0000: lib/utils/asyncFilter.js.map
➤ YN0000: lib/utils/cliConstants.d.ts
➤ YN0000: lib/utils/cliConstants.js
➤ YN0000: lib/utils/cliConstants.js.map
➤ YN0000: lib/utils/cliHelper.d.ts
➤ YN0000: lib/utils/cliHelper.js
➤ YN0000: lib/utils/cliHelper.js.map
➤ YN0000: lib/utils/fsHelper.d.ts
➤ YN0000: lib/utils/fsHelper.js
➤ YN0000: lib/utils/fsHelper.js.map
➤ YN0000: lib/utils/fsUtils.d.ts
➤ YN0000: lib/utils/fsUtils.js
➤ YN0000: lib/utils/fsUtils.js.map
➤ YN0000: lib/utils/fxpHelper.d.ts
➤ YN0000: lib/utils/fxpHelper.js
➤ YN0000: lib/utils/fxpHelper.js.map
➤ YN0000: lib/utils/gitLfsHelper.d.ts
➤ YN0000: lib/utils/gitLfsHelper.js
➤ YN0000: lib/utils/gitLfsHelper.js.map
➤ YN0000: lib/utils/ignoreHelper.d.ts
➤ YN0000: lib/utils/ignoreHelper.js
➤ YN0000: lib/utils/ignoreHelper.js.map
➤ YN0000: lib/utils/metadataDiff.d.ts
➤ YN0000: lib/utils/metadataDiff.js
➤ YN0000: lib/utils/metadataDiff.js.map
➤ YN0000: lib/utils/packageHelper.d.ts
➤ YN0000: lib/utils/packageHelper.js
➤ YN0000: lib/utils/packageHelper.js.map
➤ YN0000: lib/utils/repoGitDiff.d.ts
➤ YN0000: lib/utils/repoGitDiff.js
➤ YN0000: lib/utils/repoGitDiff.js.map
➤ YN0000: messages/delta.json
➤ YN0000: oclif.manifest.json
➤ YN0000: package.json
➤ YN0036: Calling the "postpack" lifecycle script
➤ YN0000: Package archive generated in C:\temp\troubleshooting\sfdx-git-delta\package.tgz
➤ YN0000: Done in 11s 117ms

DEBIE1TC_SFDX@MSE-SVCRM01 MINGW64 /c/temp/troubleshooting/sfdx-git-delta (main)
$ mkdir output

DEBIE1TC_SFDX@MSE-SVCRM01 MINGW64 /c/temp/troubleshooting/sfdx-git-delta (main)
$ node --inspect-brk ./bin/run -f HEAD~1 -d
Debugger listening on ws://127.0.0.1:9229/a60fb2e0-0afc-41bd-af8c-ec62a98b71ae
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.

What is the next step?

ALesc21 avatar Nov 06 '24 07:11 ALesc21

Next steps are to debug 😁 Do you have chrome on this server ? When could we schedule a screen share ?

scolladon avatar Nov 06 '24 09:11 scolladon

The chrome browser was also installed on the server. Unfortunatelly we can not access to the internet but like I understood it is also not need for the analyses. I wrote you an email to find a time slot for the screensharing.

ALesc21 avatar Nov 06 '24 11:11 ALesc21

Yes exactly, we do not need internet, we just need the chrome debugger.

scolladon avatar Nov 06 '24 11:11 scolladon