I have a solution that I can't export/import to a new environment as long as it has virtual tables. The error is below and I've checked normal stuff: I have admin privileges, no issue with the virtual tables in the source environment.
Solution contains a Canvas app, model driven app, flows, virtual tables and custom tables. If I remove all of the virtual tables, solution seems to import fine. The only only commonality that I can see is that all of the virtual tables use the same virtual table data source (which makes sense as they all live on the same SQL server).
Solution "XXXXXXX" failed to import: Failed to create entity with logical name cr0d1_client_episode_visit_with_notes and object type code 11167. Exception: Microsoft.Crm.BusinessEntities.CrmObjectNotFoundException: Cannot add EntityDataSource with id (fe48cbbb-a046-ee11-be6d-000d3a3707cb) to solution (743888ae-6f0a-4ba3-bd20-8642ff6ea973) because it does not exist at Microsoft.Crm.ObjectModel.SolutionComponentService.VerifyComponentExists(IBusinessEntity entity, ExecutionContext context) at Microsoft.Crm.ObjectModel.SolutionComponentService.AddSolutionComponent(Guid componentId, Int32 componentType, Guid solutionId, Boolean addRequiredComponents, Boolean doNotIncludeSubcomponents, String[] includedComponentSettingsValues, ExecutionContext context) at Microsoft.Crm.ObjectModel.SolutionComponentService.AddSolutionComponent(Guid componentId, Int32 componentType, Guid solutionId, Boolean addRequiredComponents, ExecutionContext context) at Microsoft.Crm.MetadataService.VirtualEntity.VirtualConnectorProviderService.AddDatasourceAndConnectionReferenceToSolution(Guid entityDataSourceId, Guid solutionId, ExecutionContext executionContext) at Microsoft.Crm.MetadataService.VirtualEntity.VirtualConnectorProviderService.PostProcessVirtualTableSyncCore(IEntityInfo entityInfo, ExecutionContext executionContext) at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute(ILogger logger, EventId eventId, ActivityType activityType, Action action, IEnumerable`1 additionalCustomProperties) at Microsoft.Crm.MetadataService.VirtualEntity.VirtualConnectorProviderService.PostProcessVirtualTableSync(IEntityInfo entityInfo, ExecutionContext executionContext) at Microsoft.Crm.Metadata.EntityService.PostProcessVirtualConnectorProviderEntity(ExecutionContext context, EntityCreateInfo entityInfo, Boolean isInSolutionImportMode) at Microsoft.Crm.Metadata.EntityService.CreateInternalHelper(EntityCreateInfo entityInfo, MetadataHelper metadataHelper, Boolean shouldCreateOnlyFromReserve, ExecutionContext context)