Help With Perforce Error - Unable to stop perforce from checking when using GIT

I haven’t seen these errors before, mostly because I’ve been using GIT (LFS) for personal backups over Perforce. The steps to repeat what I did were to try and commit from the application (Unreal Engine 5) and then not seeing anything for a bit I impatiently pushed from the git app, as well. Somehow this seems to have confused Unreal engine into thinking I wanted to use perforce? (Which is installed on my PC and I had used on a previous project)

Has anyone come across the “Not marked for add” error with perforce? Note, I use GIT LFS. I tried googling this and nothing comes up. I tried disabling and re-enabling the source control with git, but it still won’t “forget” the perforce option. Also it was found that this error was occuring when hitting check content and I was unsure if related to the main issue or not?

LogLyraEditor: Warning: Assets to validate (2943) exceeded -MaxPackagesToLoad=(2000). Skipping existing package validation.
AssetCheck: Warning: Assets to validate (2943) exceeded -MaxPackagesToLoad=(2000). Skipping existing package validation.

I tried setting this to:
int32 MaxPackagesToLoad = 3000;

Below are the Message Log errors I’m receiving:
[AssetLog] G:\Active\LyraStarterGame\Content\System\DefaultEditorMap\L_DefaultEditorOverview.umap: References /Engine/EngineMaterials/WorldGridMaterial which is not marked for add in perforce. (EditorValidator_SourceControl)
[AssetLog] G:\Active\LyraStarterGame\Content\System\DefaultEditorMap\L_DefaultEditorOverview.umap: References /Engine/EngineSky/BP_Sky_Sphere which is not marked for add in perforce. (EditorValidator_SourceControl)
[AssetLog] G:\Active\LyraStarterGame\Content\System\DefaultEditorMap\L_DefaultEditorOverview.umap: References /Engine/EngineSky/M_Sky_Panning_Clouds2 which is not marked for add in perforce. (EditorValidator_SourceControl)
[AssetLog] G:\Active\LyraStarterGame\Content\System\DefaultEditorMap\L_DefaultEditorOverview.umap: References /LyraExampleContent/Materials/MI_MS_Blue_1 which is not marked for add in perforce. (EditorValidator_SourceControl)
[AssetLog] G:\Active\LyraStarterGame\Content\System\DefaultEditorMap\L_DefaultEditorOverview.umap: References /Engine/BasicShapes/Cube which is not marked for add in perforce. (EditorValidator_SourceControl)
[AssetLog] G:\Active\LyraStarterGame\Content\System\DefaultEditorMap\L_DefaultEditorOverview.umap: References /LyraExampleContent/Materials/MI_MS_Orange_1 which is not marked for add in perforce. (EditorValidator_SourceControl)
[AssetLog] G:\Active\LyraStarterGame\Content\System\DefaultEditorMap\L_DefaultEditorOverview.umap: References /Engine/BasicShapes/BasicShapeMaterial which is not marked for add in perforce. (EditorValidator_SourceControl)
/Game/System/DefaultEditorMap/L_DefaultEditorOverview contains invalid data.
Data validation FAILED.
Files Checked: 1, Passed: 0, Failed: 1, Skipped: 0, Unable to validate: 0

1 Like

I have the same error using SVN with a Lyra project.

I actually deleted the entire git repo (both locally removing git files and on the server) and redid it more patiently and the error still exists.

Receiving the same error, even after deleting and recloning. Currently using git with an Azure Repos remote. I can seemingly still commit changes to the asset from what I can tell, but only using Sourcetree. When trying to save any asset in-editor, I get the errors. **Also using the Lyra project.

– This is the specific error from the output log in Rider.

Log LogSlate Window ‘Submit Files’ being destroyed
Log LogSourceControl commit successful: [dev 06bab30f] Test
Log SourceControl [dev 06bab30f] Test
Log SourceControl 1 file changed, 0 insertions(+), 0 deletions(-)
Log SourceControl Commited [dev 06bab30f] Test.
Log AssetCheck New page: Asset Save: B_ControlPointScoring
Display LogContentValidation Validating Blueprint /ShooterCore/ControlPoint/B_ControlPointScoring.B_ControlPointScoring
Error AssetCheck [AssetLog] C:\Repos*\Plugins\GameFeatures\ShooterCore\Content\ControlPoint\B_ControlPointScoring.uasset: References /Engine/EditorBlueprintResources/ActorComponentMacros which is not marked for add in perforce. (EditorValidator_SourceControl)
Error AssetCheck [AssetLog] C:\Repos*
\Plugins\GameFeatures\ShooterCore\Content\ControlPoint\B_ControlPointScoring.uasset: References /Engine/EditorBlueprintResources/StandardMacros which is not marked for add in perforce. (EditorValidator_SourceControl)
Log AssetCheck /ShooterCore/ControlPoint/B_ControlPointScoring contains invalid data.
Log AssetCheck Data validation FAILED.
Log AssetCheck Files Checked: 1, Passed: 0, Failed: 1, Skipped: 0, Unable to validate: 0
Warning LogPackageName FPackagePath::TryFromMountedName was passed an ObjectPath (/ShooterCore/ControlPoint/B_ControlPointScoring.B_ControlPointScoring) rather than a PackageName or FilePath; it will be converted to the PackageName. Accepting ObjectPaths is deprecated behavior and will be removed in a future release; TryFromMountedName will fail on ObjectPaths.

– Seemingly an issue with the Blueprint referencing an engine asset that’s not part of the repo? Here’s the C++ validation that’s occurring, causing the failure:

EDataValidationResult UEditorValidator_SourceControl::ValidateLoadedAsset_Implementation(UObject* InAsset, TArray& ValidationErrors)
{
check(InAsset);

FName PackageFName = InAsset->GetOutermost()->GetFName();
if (FPackageName::DoesPackageExist(PackageFName.ToString()))
{
	ISourceControlProvider& SourceControlProvider = ISourceControlModule::Get().GetProvider();
	FSourceControlStatePtr AssetState = SourceControlProvider.GetState(SourceControlHelpers::PackageFilename(PackageFName.ToString()), EStateCacheUsage::Use);
	if (AssetState.IsValid() && AssetState->IsSourceControlled())
	{
		FAssetRegistryModule& AssetRegistryModule = FModuleManager::LoadModuleChecked<FAssetRegistryModule>(TEXT("AssetRegistry"));
		IAssetRegistry& AssetRegistry = AssetRegistryModule.Get();

		// Check for assets that are submitted to source control that reference assets that are not
		static const FString ScriptPackagePrefix = TEXT("/Script/");
		TArray<FName> Dependencies;
		AssetRegistry.GetDependencies(PackageFName, Dependencies, UE::AssetRegistry::EDependencyCategory::Package);
		for (FName Dependency : Dependencies)
		{
			const FString DependencyStr = Dependency.ToString();
			if (!DependencyStr.StartsWith(ScriptPackagePrefix))
			{
				FSourceControlStatePtr DependencyState = SourceControlProvider.GetState(SourceControlHelpers::PackageFilename(DependencyStr), EStateCacheUsage::Use);
				if (DependencyState.IsValid() && !DependencyState->IsSourceControlled())
				{
					AssetFails(InAsset, FText::Format(LOCTEXT("SourceControl_NotMarkedForAdd", "References {0} which is not marked for add in perforce"), FText::FromString(DependencyStr)), ValidationErrors);
				}
			}
		}
	}
}

Also, these blueprints are unchanged, and I haven’t made any modifications to them.

I’m having this issue, but I’m using Plastic. Also building on top of Lyra.

Repro steps are to duplicate and rename the “W_LyraSettingsScreen” asset and attempt to save it, since it depends on “/CommonUI/GenericInputActionDataTable” which is in “Engine/Plugins/CommonUIPluginContent/”

Really, it shouldn’t have a problem with any unchanged assets right?

Ditto, using Tortoise SVN with Lyra.

Nobody seems to have a solution for this.

It seems like UE5 is just fundamentally broken if you use Git rather than Perforce. The only way to get UE5 to shut up is to disable its internal version control and manage version control externally via real Git tools.

Am I mistaken?

The error is introduced by code that is in the Lyra source code, not the engine. Check out the ValidateLoadedAsset_Implementation() function in /Source/LyraEditor/Validation/EditorValidator_SourceControl.cpp:

EDataValidationResult UEditorValidator_SourceControl::ValidateLoadedAsset_Implementation(UObject* InAsset, TArray<FText>& ValidationErrors)
{
	check(InAsset);

	FName PackageFName = InAsset->GetOutermost()->GetFName();
	if (FPackageName::DoesPackageExist(PackageFName.ToString()))
	{
		ISourceControlProvider& SourceControlProvider = ISourceControlModule::Get().GetProvider();
		FSourceControlStatePtr AssetState = SourceControlProvider.GetState(SourceControlHelpers::PackageFilename(PackageFName.ToString()), EStateCacheUsage::Use);
		if (AssetState.IsValid() && AssetState->IsSourceControlled())
		{
			FAssetRegistryModule& AssetRegistryModule = FModuleManager::LoadModuleChecked<FAssetRegistryModule>(TEXT("AssetRegistry"));
			IAssetRegistry& AssetRegistry = AssetRegistryModule.Get();

			// Check for assets that are submitted to source control that reference assets that are not
			static const FString ScriptPackagePrefix = TEXT("/Script/");
			TArray<FName> Dependencies;
			AssetRegistry.GetDependencies(PackageFName, Dependencies, UE::AssetRegistry::EDependencyCategory::Package);
			for (FName Dependency : Dependencies)
			{
				const FString DependencyStr = Dependency.ToString();
				if (!DependencyStr.StartsWith(ScriptPackagePrefix))
				{
					FSourceControlStatePtr DependencyState = SourceControlProvider.GetState(SourceControlHelpers::PackageFilename(DependencyStr), EStateCacheUsage::Use);
					if (DependencyState.IsValid() && !DependencyState->IsSourceControlled())
					{
						AssetFails(InAsset, FText::Format(LOCTEXT("SourceControl_NotMarkedForAdd", "References {0} which is not marked for add in perforce"), FText::FromString(DependencyStr)), ValidationErrors);
					}
				}
			}
		}
	}

	if (GetValidationResult() != EDataValidationResult::Invalid)
	{
		AssetPasses(InAsset);
	}

	return GetValidationResult();
}

Somewhere in that function is what is throwing the error. I’m not sure why, though - this may be an engine problem manifesting. Either way, you can just replace it with the following to “disable” the check:

EDataValidationResult UEditorValidator_SourceControl::ValidateLoadedAsset_Implementation(UObject* InAsset, TArray<FText>& ValidationErrors)
{
    // FIXME
    return EDataValidationResult::Valid;
}
1 Like