Skip to content

Unable to execute CLI commands due to service constructor #265

@victorfrye

Description

@victorfrye

After a fresh installation of Foundry Local using WinGet, I get errors on all CLI commands with errors related to service constructor and singleton trying to consume scoped service:

Microsoft.FoundryLocal version: 0.7.117.26375

Top of logs below, but there's more if helpful. I've tried reinstalling without any success. Commands I've tried:

foundry --help
foundry --version
foundry model ls

Microsoft.AI.Foundry.Local.Fallback[0]
      An unexpected error occurred.
Exception: Some services are not able to be constructed (Error while validating the service descriptor 'ServiceType: Microsoft.AI.Foundry.Local.Common.IModelManagement Lifetime: Singleton ImplementationType: Microsoft.AI.Foundry.Local.Common.ModelManagement': Cannot consume scoped service 'Microsoft.AI.Foundry.Local.Common.ITelemetry' from singleton 'Microsoft.AI.Foundry.Local.Common.IAzureFoundryCatalog'.) (Error while validating the service descriptor 'ServiceType: Microsoft.AI.Foundry.Local.Common.IAzureFoundryCatalog Lifetime: Singleton ImplementationType: Microsoft.AI.Foundry.Local.Catalog.AzureFoundryCatalog': Cannot consume scoped service 'Microsoft.AI.Foundry.Local.Common.ITelemetry' from singleton 'Microsoft.AI.Foundry.Local.Common.IAzureFoundryCatalog'.) (Error while validating the service descriptor 'ServiceType: Microsoft.AI.Foundry.Local.FoundryLocal Lifetime: Singleton ImplementationType: Microsoft.AI.Foundry.Local.FoundryLocal': Cannot consume scoped service 'Microsoft.AI.Foundry.Local.Common.ITelemetry' from singleton 'Microsoft.AI.Foundry.Local.Common.IAzureFoundryCatalog'.) (Error while validating the service descriptor 'ServiceType: Microsoft.AI.Foundry.Local.Commands.ICommandBuilder Lifetime: Singleton ServiceKey: CacheCdCommand KeyedImplementationType: Microsoft.AI.Foundry.Local.Commands.CacheCdCommand': Cannot consume scoped service 'Microsoft.AI.Foundry.Local.Common.ITelemetry' from singleton 'Microsoft.AI.Foundry.Local.Common.IAzureFoundryCatalog'.) (Error while validating the service descriptor 'ServiceType: Microsoft.AI.Foundry.Local.Commands.ICommandBuilder Lifetime: Singleton ServiceKey: CacheListCommand KeyedImplementationType: Microsoft.AI.Foundry.Local.Commands.CacheListCommand': Cannot consume scoped service 'Microsoft.AI.Foundry.Local.Common.ITelemetry' from singleton 'Microsoft.AI.Foundry.Local.Common.IAzureFoundryCatalog'.) (Error while validating the service descriptor 'ServiceType: Microsoft.AI.Foundry.Local.Commands.ICommandBuilder Lifetime: Singleton ServiceKey: CacheLocationCommand KeyedImplementationType: Microsoft.AI.Foundry.Local.Commands.CacheLocationCommand': Cannot consume scoped service 'Microsoft.AI.Foundry.Local.Common.ITelemetry' from singleton 'Microsoft.AI.Foundry.Local.Common.IAzureFoundryCatalog'.) (Error while validating the service descriptor 'ServiceType: Microsoft.AI.Foundry.Local.Commands.ICommandBuilder Lifetime: Singleton ServiceKey: CacheRemoveCommand KeyedImplementationType: Microsoft.AI.Foundry.Local.Commands.CacheRemoveCommand': Cannot consume scoped service 'Microsoft.AI.Foundry.Local.Common.ITelemetry' from singleton 'Microsoft.AI.Foundry.Local.Common.IAzureFoundryCatalog'.) (Error while validating the service descriptor 'ServiceType: Microsoft.AI.Foundry.Local.Commands.ICommandBuilder Lifetime: Singleton ServiceKey: ModelDownloadCommand KeyedImplementationType: Microsoft.AI.Foundry.Local.Commands.ModelDownloadCommand': Cannot consume scoped service 'Microsoft.AI.Foundry.Local.Common.ITelemetry' from singleton 'Microsoft.AI.Foundry.Local.Common.IAzureFoundryCatalog'.) (Error while validating the service descriptor 'ServiceType: Microsoft.AI.Foundry.Local.Commands.ICommandBuilder Lifetime: Singleton ServiceKey: ModelInfoCommand KeyedImplementationType: Microsoft.AI.Foundry.Local.Commands.ModelInfoCommand': Cannot consume scoped service 'Microsoft.AI.Foundry.Local.Common.ITelemetry' from singleton 'Microsoft.AI.Foundry.Local.Common.IAzureFoundryCatalog'.) (Error while validating the service descriptor 'ServiceType: Microsoft.AI.Foundry.Local.Commands.ICommandBuilder Lifetime: Singleton ServiceKey: ModelListCommand KeyedImplementationType: Microsoft.AI.Foundry.Local.Commands.ModelListCommand': Cannot consume scoped service 'Microsoft.AI.Foundry.Local.Common.ITelemetry' from singleton 'Microsoft.AI.Foundry.Local.Common.IAzureFoundryCatalog'.) (Error while validating the service descriptor 'ServiceType: Microsoft.AI.Foundry.Local.Commands.ICommandBuilder Lifetime: Singleton ServiceKey: ModelLoadCommand KeyedImplementationType: Microsoft.AI.Foundry.Local.Commands.ModelLoadCommand': Cannot consume scoped service 'Microsoft.AI.Foundry.Local.Common.ITelemetry' from singleton 'Microsoft.AI.Foundry.Local.Common.IAzureFoundryCatalog'.) (Error while validating the service descriptor 'ServiceType: Microsoft.AI.Foundry.Local.Commands.ICommandBuilder Lifetime: Singleton ServiceKey: ModelRunCommand KeyedImplementationType: Microsoft.AI.Foundry.Local.Commands.ModelRunCommand': Cannot consume scoped service 'Microsoft.AI.Foundry.Local.Common.ITelemetry' from singleton 'Microsoft.AI.Foundry.Local.Common.IAzureFoundryCatalog'.) (Error while validating the service descriptor 'ServiceType: Microsoft.AI.Foundry.Local.Commands.ICommandBuilder Lifetime: Singleton ServiceKey: ModelUnloadCommand KeyedImplementationType: Microsoft.AI.Foundry.Local.Commands.ModelUnloadCommand': Cannot consume scoped service 'Microsoft.AI.Foundry.Local.Common.ITelemetry' from singleton 'Microsoft.AI.Foundry.Local.Common.IAzureFoundryCatalog'.) (Error while validating the service descriptor 'ServiceType: Microsoft.AI.Foundry.Local.Commands.ICommandBuilder Lifetime: Singleton ServiceKey: ServiceListCommand KeyedImplementationType: Microsoft.AI.Foundry.Local.Commands.ServiceListCommand': Cannot consume scoped service 'Microsoft.AI.Foundry.Local.Common.ITelemetry' from singleton 'Microsoft.AI.Foundry.Local.Common.IAzureFoundryCatalog'.) (Error while validating the service descriptor 'ServiceType: Microsoft.AI.Foundry.Local.Commands.ICommandBuilder Lifetime: Singleton ServiceKey: ServiceRestartCommand KeyedImplementationType: Microsoft.AI.Foundry.Local.Commands.ServiceRestartCommand': Cannot consume scoped service 'Microsoft.AI.Foundry.Local.Common.ITelemetry' from singleton 'Microsoft.AI.Foundry.Local.Common.IAzureFoundryCatalog'.) (Error while validating the service descriptor 'ServiceType: Microsoft.AI.Foundry.Local.Commands.ICommandBuilder Lifetime: Singleton ServiceKey: ServiceSetCommand KeyedImplementationType: Microsoft.AI.Foundry.Local.Commands.ServiceSetCommand': Cannot consume scoped service 'Microsoft.AI.Foundry.Local.Common.ITelemetry' from singleton 'Microsoft.AI.Foundry.Local.Common.IAzureFoundryCatalog'.) (Error while validating the service descriptor 'ServiceType: Microsoft.AI.Foundry.Local.Commands.ICommandBuilder Lifetime: Singleton ServiceKey: ServiceStartCommand KeyedImplementationType: Microsoft.AI.Foundry.Local.Commands.ServiceStartCommand': Cannot consume scoped service 'Microsoft.AI.Foundry.Local.Common.ITelemetry' from singleton 'Microsoft.AI.Foundry.Local.Common.IAzureFoundryCatalog'.) (Error while validating the service descriptor 'ServiceType: Microsoft.AI.Foundry.Local.Commands.ICommandBuilder Lifetime: Singleton ServiceKey: ServiceStatusCommand KeyedImplementationType: Microsoft.AI.Foundry.Local.Commands.ServiceStatusCommand': Cannot consume scoped service 'Microsoft.AI.Foundry.Local.Common.ITelemetry' from singleton 'Microsoft.AI.Foundry.Local.Common.IAzureFoundryCatalog'.) (Error while validating the service descriptor 'ServiceType: Microsoft.AI.Foundry.Local.Commands.ICommandBuilder Lifetime: Singleton ServiceKey: ServiceStopCommand KeyedImplementationType: Microsoft.AI.Foundry.Local.Commands.ServiceStopCommand': Cannot consume scoped service 'Microsoft.AI.Foundry.Local.Common.ITelemetry' from singleton 'Microsoft.AI.Foundry.Local.Common.IAzureFoundryCatalog'.) (Error while validating the service descriptor 'ServiceType: Microsoft.AI.Foundry.Local.Commands.ICommandBuilder Lifetime: Singleton ServiceKey: ServiceInitCommand KeyedImplementationType: Microsoft.AI.Foundry.Local.Commands.ServiceInitCommand': Cannot consume scoped service 'Microsoft.AI.Foundry.Local.Common.ITelemetry' from singleton 'Microsoft.AI.Foundry.Local.Common.IAzureFoundryCatalog'.) (Error while validating the service descriptor 'ServiceType: Microsoft.AI.Foundry.Local.Commands.ICommandBuilder Lifetime: Singleton ServiceKey: ServiceDiagnosticCommand KeyedImplementationType: Microsoft.AI.Foundry.Local.Commands.ServiceDiagnosticCommand': Cannot consume scoped service 'Microsoft.AI.Foundry.Local.Common.ITelemetry' from singleton 'Microsoft.AI.Foundry.Local.Common.IAzureFoundryCatalog'.)
Error while validating the service descriptor 'ServiceType: Microsoft.AI.Foundry.Local.Common.IModelManagement Lifetime: Singleton ImplementationType: Microsoft.AI.Foundry.Local.Common.ModelManagement': Cannot consume scoped service 'Microsoft.AI.Foundry.Local.Common.ITelemetry' from singleton 'Microsoft.AI.Foundry.Local.Common.IAzureFoundryCatalog'.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions