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

Source enabled Sandbox. Metadata are false reported as conflicted or changed. #1178

Closed
PawelWozniak opened this issue Sep 8, 2021 · 5 comments
Labels
investigating We're actively investigating this issue

Comments

@PawelWozniak
Copy link

Summary

I synchronize sandbox with source control to state that force:source:status says "No result found".
Then edit some classes (VSCode) and save them.
When check the status I am getting conflicting versions.

Steps To Reproduce:

  1. Have a source sync enabled sandbox
  2. do force:source:push to fill it in with content of git repo
  3. edit some class and save them from VSCode, check force:source:status
    You will get:
=== Source Status
STATE                      FULL NAME                                TYPE         PROJECT PATH
─────────────────────────  ───────────────────────────────────────  ───────────  ────────────────────────────────────────────────────────────────────────────────────────────
Local Changed (Conflict)   Constants                                ApexClass    force-app\main\default\classes\Constants.cls
Local Changed (Conflict)   Utils                                    ApexClass    force-app\main\default\classes\Utils\Utils.cls
Local Changed (Conflict)   Utils_Test                               ApexClass    force-app\main\default\classes\Utils\Utils_Test.cls
  1. Now you can't pull or push.
sfdx force:source:pull  
ERROR:  We couldn’t complete the pull operation due to conflicts. Verify that you want to keep the remote versions, then run "sfdx force:source:pull -f" with the --forceoverwrite (-f) option.
STATE     FULL NAME               TYPE       PROJECT PATH
────────  ──────────────────────  ─────────  ─────────────────────────────────────────────────────────────────────────
Conflict  Constants               ApexClass  force-app\main\default\classes\Constants.cls
Conflict  Utils                   ApexClass  force-app\main\default\classes\Utils\Utils.cls
Conflict  Utils_Test              ApexClass  force-app\main\default\classes\Utils\Utils_Test.cls
ERROR running force:source:pull:  Source conflict(s) detected.
sfdx force:source:push
ERROR:  We couldn't complete the push operation due to conflicts. Verify that you want to keep the local versions, then run "sfdx force:source:push -f" with the --forceoverwrite (-f) option.
STATE     FULL NAME               TYPE       PROJECT PATH
────────  ──────────────────────  ─────────  ─────────────────────────────────────────────────────────────────────────
Conflict  Constants               ApexClass  force-app\main\default\classes\Constants.cls
Conflict  Utils                   ApexClass  force-app\main\default\classes\Utils\Utils.cls
Conflict  Utils_Test              ApexClass  force-app\main\default\classes\Utils\Utils_Test.cls
ERROR running force:source:push:  Source conflict(s) detected.
  1. Force push, overwrite conflicts. (there were more components)
 sfdx force:source:push -f
*** Deploying with SOAP ***
Job ID | 0Af3O00000tbGG0SAM
SOURCE PROGRESS | ████████████████████████████████████████ | 100/100 Components
*** Deploying with SOAP ***
Job ID | 0Af3O00000tbGM9SAM
SOURCE PROGRESS | ████████████████████████████████████████ | 1/1 Components
=== Pushed Source
STATE    FULL NAME                                TYPE         PROJECT PATH
───────  ───────────────────────────────────────  ───────────  ────────────────────────────────────────────────────────────────────────────────────────────
Changed  Constants                                ApexClass    force-app\main\default\classes\Constants.cls
Changed  Utils                                    ApexClass    force-app\main\default\classes\Utils\Utils.cls
Changed  Utils_Test                               ApexClass    force-app\main\default\classes\Utils\Utils_Test.cls
  1. Check if forcing overwrites of conflicts solved it? Expecting that files in SF were replaced with local version.
    You see that the remote has been changed. Why? We have just overwritten the remote version in previous step.
sfdx force:source:status 
=== Source Status
STATE           FULL NAME               TYPE       PROJECT PATH
──────────────  ──────────────────────  ─────────  ──────────────────────────────────────────────────────────────────────────────────
Remote Changed  Constants               ApexClass  force-app\main\default\classes\Constants.cls
Remote Changed  Constants               ApexClass  force-app\main\default\classes\Constants.cls-meta.xml
Remote Changed  Utils                   ApexClass  force-app\main\default\classes\Utils\Utils.cls
Remote Changed  Utils                   ApexClass  force-app\main\default\classes\Utils\Utils.cls-meta.xml
Remote Changed  Utils_Test              ApexClass  force-app\main\default\classes\Utils\Utils_Test.cls
Remote Changed  Utils_Test              ApexClass  force-app\main\default\classes\Utils\Utils_Test.cls-meta.xml
  1. Ok so lets get those versions to local computer to check what has been changed. But why those changes were not downloaded?
sfdx force:source:pull   
=== Pulled Source
STATE    FULL NAME           TYPE  PROJECT PATH
───────  ──────────────────  ────  ─────────────────────────────────────────────────────────────
Changed  Update_Gantt_Label  Flow  force-app\main\default\flows\Update_Gantt_Label.flow-meta.xml
  1. Do they still appear as changed? No. Despite not beating downloaded (or listed as) they are no longer listed as changed.
sfdx force:source:status
=== Source Status
No results found
  1. Git is not showing any changes in files after pulling metadata from sandbox. So no local files were changed.

Expected result

Files in SF are saved as they are represented in git repository
Only real conflicts are shown.

Actual result

Conflicts are shown even if the file was saved from VSCode
Just after force pushing code to sandbox code is immediately altered in SF and shown as changed.
Pulling changes don't list files as pulled, files are not changed in the filesystem but status says that they are no longer different from SF.

System Information

{
        "cliVersion": "sfdx-cli/7.116.2",
        "architecture": "win32-x64",
        "nodeVersion": "node-v14.17.5",
        "pluginVersions": [
                "@oclif/plugin-autocomplete 0.3.0 (core)",
                "@oclif/plugin-commands 1.3.0 (core)",
                "@oclif/plugin-help 3.2.2 (core)",
                "@oclif/plugin-not-found 1.2.4 (core)",
                "@oclif/plugin-plugins 1.10.1 (core)",
                "@oclif/plugin-update 1.4.0-3 (core)",
                "@oclif/plugin-warn-if-update-available 1.7.0 (core)",
                "@oclif/plugin-which 1.0.3 (core)",
                "@salesforce/sfdx-diff 0.0.6",
                "@salesforce/sfdx-plugin-lwc-test 0.1.7 (core)",
                "@salesforce/sfdx-trust 3.6.0 (core)",
                "alias 1.1.10 (core)",
                "apex 0.2.8 (core)",
                "auth 1.7.1 (core)",
                "bbdoc 3.6.1",
                "config 1.2.24 (core)",
                "custom-metadata 1.0.12 (core)",
                "data 0.6.1 (core)",
                "generator 1.1.7 (core)",
                "limits 1.2.1 (core)",
                "org 1.7.0 (core)",
                "salesforce-alm 52.3.1 (core)",
                "schema 1.0.8 (core)",
                "sfdx-cli 7.116.2 (core)",
                "sfdx-git-delta 4.8.1",
                "sfpowerkit 3.2.2",
                "source 1.0.12 (core)",
                "telemetry 1.2.3 (core)",
                "templates 52.1.0 (core)",
                "user 1.4.0 (core)"
        ],
        "osVersion": "Windows_NT 10.0.19043"
}

Additional information

Feel free to attach a screenshot.

@PawelWozniak PawelWozniak added the investigating We're actively investigating this issue label Sep 8, 2021
@github-actions
Copy link

github-actions bot commented Sep 8, 2021

Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.

@PawelWozniak
Copy link
Author

It might be related to this issue forcedotcom/salesforcedx-vscode#3522 as conflict detection probably detect those conflicts that are created after file is saved to SF.

@mshanemc
Copy link
Contributor

@PawelWozniak do these conflicts only happen on a source-tracking sandbox and not on a scratch org? [trying to narrow down how to reproduce this and what code to explore]

@mshanemc mshanemc added the more information required Issue requires more information or a response from the customer label Sep 28, 2021
@PawelWozniak
Copy link
Author

I am not sure as I am not using scratch orgs because we have many managed packages installed.
When I will have a time in next few days I will check it on scratch org.

@no-response no-response bot removed the more information required Issue requires more information or a response from the customer label Oct 4, 2021
@mshanemc
Copy link
Contributor

mshanemc commented Nov 7, 2023

I'm closing this, since VSCode was able to fix forcedotcom/salesforcedx-vscode#3542.

If it's still reproducible in current CLI/plugins, please open a new issue (preferably with repro steps using only the CLI, to keep the VSCode issues separate).

@mshanemc mshanemc closed this as completed Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigating We're actively investigating this issue
Projects
None yet
Development

No branches or pull requests

2 participants