Closed ceddup closed 1 year ago
Can you check the log file after the first error?
Sure here you go :
2023-06-16 09:31:57,048 [6] Orchard.Data.Migration.DataMigrationManager - Default - Error while running migration version 0 for Settings. [http://localhost:30321/OrchardLocal/]
System.Reflection.TargetInvocationException: Une exception a été levée par la cible d'un appel. ---> NHibernate.Exceptions.GenericADOException: could not execute query
[ select contentpar0_.Id as Id120, contentpar1_.Id as Id131, contentfie2_.Id as Id112, contentpar0_.Name as Name120, contentpar0_.Hidden as Hidden120, contentpar0_.Settings as Settings120, contentpar1_.Name as Name131, contentpar1_.Settings as Settings131, contentpar1_.ContentFieldDefinitionRecord_id as ContentF4_131, contentpar1_.ContentPartDefinitionRecord_id as ContentP5_0, contentpar1_.Id as Id0_, contentfie2.Name as Name112 from SettingsContentPartDefinitionRecord contentpar0 left outer join SettingsContentPartFieldDefinitionRecord contentpar1 on contentpar0.Id=contentpar1.ContentPartDefinitionRecord_id left outer join SettingsContentFieldDefinitionRecord contentfie2 on contentpar1_.ContentFieldDefinitionRecordid=contentfie2.Id ]
[SQL: select contentpar0_.Id as Id120, contentpar1_.Id as Id131, contentfie2_.Id as Id112, contentpar0_.Name as Name120, contentpar0_.Hidden as Hidden120, contentpar0_.Settings as Settings120, contentpar1_.Name as Name131, contentpar1_.Settings as Settings131, contentpar1_.ContentFieldDefinitionRecord_id as ContentF4_131, contentpar1_.ContentPartDefinitionRecord_id as ContentP5_0, contentpar1_.Id as Id0, contentfie2_.Name as Name112 from SettingsContentPartDefinitionRecord contentpar0 left outer join SettingsContentPartFieldDefinitionRecord contentpar1 on contentpar0.Id=contentpar1.ContentPartDefinitionRecord_id left outer join SettingsContentFieldDefinitionRecord contentfie2 on contentpar1_.ContentFieldDefinitionRecordid=contentfie2.Id] ---> System.Data.SqlClient.SqlException: Nom de colonne non valide : 'ContentPartDefinitionRecord_id'.
Nom de colonne non valide : 'ContentPartDefinitionRecord_id'.
à System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) à System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) à System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) à System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() à System.Data.SqlClient.SqlDataReader.get_MetaData() à System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted) à System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest) à System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource
1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
à System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
à System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
à NHibernate.AdoNet.AbstractBatcher.ExecuteReader(IDbCommand cmd)
à NHibernate.Loader.Loader.GetResultSet(IDbCommand st, Boolean autoDiscoverTypes, Boolean callable, RowSelection selection, ISessionImplementor session)
à NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies, IResultTransformer forcedResultTransformer)
à NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies, IResultTransformer forcedResultTransformer)
à NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters, IResultTransformer forcedResultTransformer)
--- Fin de la trace de la pile d'exception interne ---
à NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters, IResultTransformer forcedResultTransformer)
à NHibernate.Loader.Loader.ListIgnoreQueryCache(ISessionImplementor session, QueryParameters queryParameters)
à NHibernate.Loader.Hql.QueryLoader.List(ISessionImplementor session, QueryParameters queryParameters)
à NHibernate.Hql.Ast.ANTLR.QueryTranslatorImpl.List(ISessionImplementor session, QueryParameters queryParameters)
à NHibernate.Engine.Query.HQLQueryPlan.PerformList(QueryParameters queryParameters, ISessionImplementor session, IList results)
à NHibernate.Impl.SessionImpl.List(IQueryExpression queryExpression, QueryParameters queryParameters, IList results)
à NHibernate.Impl.AbstractSessionImpl.List(IQueryExpression queryExpression, QueryParameters parameters)
à NHibernate.Impl.AbstractQueryImpl2.List()
à NHibernate.Linq.DefaultQueryProvider.ExecuteQuery(NhLinqExpression nhLinqExpression, IQuery query, NhLinqExpression nhQuery)
à NHibernate.Linq.DefaultQueryProvider.Execute(Expression expression)
à NHibernate.Linq.DefaultQueryProvider.Execute[TResult](Expression expression)
à Remotion.Linq.QueryableBase1.GetEnumerator() à Orchard.Data.FetchRequest
2.GetEnumerator() dans C:\Travail\OrchardCMS\src\Orchard\Data\FetchRequest.cs:ligne 36
à System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() à System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable
1 source, Func2 keySelector, Func
2 elementSelector, IEqualityComparer`1 comparer)
à Orchard.Core.Settings.Metadata.ContentDefinitionManager.1 ctx) dans C:\Travail\OrchardCMS\src\Orchard.Web\Core\Settings\Metadata\ContentDefinitionManager.cs:ligne 151 à Orchard.Caching.Cache
2.CreateEntry(TKey k, Func2 acquire) dans C:\Travail\OrchardCMS\src\Orchard\Caching\Cache.cs:ligne 57 à Orchard.Caching.Cache
2.AddEntry(TKey k, Func2 acquire) dans C:\Travail\OrchardCMS\src\Orchard\Caching\Cache.cs:ligne 27 à Orchard.Caching.Cache
2.<>cDisplayClass3_0.2.AddOrUpdate(TKey key, Func
2 addValueFactory, Func3 updateValueFactory) à Orchard.Caching.Cache
2.Get(TKey key, Func2 acquire) dans C:\Travail\OrchardCMS\src\Orchard\Caching\Cache.cs:ligne 17 à Orchard.Caching.DefaultCacheManager.Get[TKey,TResult](TKey key, Func
2 acquire) dans C:\Travail\OrchardCMS\src\Orchard\Caching\DefaultCacheManager.cs:ligne 33
à Orchard.Caching.CacheManagerExtensions.Get[TKey,TResult](ICacheManager cacheManager, TKey key, Boolean preventConcurrentCalls, Func`2 acquire) dans C:\Travail\OrchardCMS\src\Orchard\Caching\ICacheManager.cs:ligne 13
à Orchard.Core.Settings.Metadata.ContentDefinitionManager.AcquireContentPartDefinitions() dans C:\Travail\OrchardCMS\src\Orchard.Web\Core\Settings\Metadata\ContentDefinitionManager.cs:ligne 143
à Orchard.Core.Settings.Metadata.ContentDefinitionManager.1 ctx) dans C:\Travail\OrchardCMS\src\Orchard.Web\Core\Settings\Metadata\ContentDefinitionManager.cs:ligne 131 à Orchard.Caching.Cache
2.CreateEntry(TKey k, Func2 acquire) dans C:\Travail\OrchardCMS\src\Orchard\Caching\Cache.cs:ligne 57 à Orchard.Caching.Cache
2.AddEntry(TKey k, Func2 acquire) dans C:\Travail\OrchardCMS\src\Orchard\Caching\Cache.cs:ligne 27 à Orchard.Caching.Cache
2.<>c2.AddOrUpdate(TKey key, Func
2 addValueFactory, Func3 updateValueFactory) à Orchard.Caching.Cache
2.Get(TKey key, Func2 acquire) dans C:\Travail\OrchardCMS\src\Orchard\Caching\Cache.cs:ligne 17 à Orchard.Caching.DefaultCacheManager.Get[TKey,TResult](TKey key, Func
2 acquire) dans C:\Travail\OrchardCMS\src\Orchard\Caching\DefaultCacheManager.cs:ligne 33
à Orchard.Caching.CacheManagerExtensions.Get[TKey,TResult](ICacheManager cacheManager, TKey key, Boolean preventConcurrentCalls, Func2 acquire) dans C:\Travail\OrchardCMS\src\Orchard\Caching\ICacheManager.cs:ligne 13 à Orchard.Core.Settings.Metadata.ContentDefinitionManager.AcquireContentTypeDefinitions() dans C:\Travail\OrchardCMS\src\Orchard.Web\Core\Settings\Metadata\ContentDefinitionManager.cs:ligne 128 à Orchard.Core.Settings.Metadata.ContentDefinitionManager.GetTypeDefinition(String name) dans C:\Travail\OrchardCMS\src\Orchard.Web\Core\Settings\Metadata\ContentDefinitionManager.cs:ligne 44 à Orchard.ContentManagement.MetaData.ContentDefinitionManagerExtensions.AlterTypeDefinition(IContentDefinitionManager manager, String name, Action
1 alteration) dans C:\Travail\OrchardCMS\src\Orchard\ContentManagement\MetaData\IContentDefinitionManager.cs:ligne 24
à Orchard.Core.Settings.Migrations.Create() dans C:\Travail\OrchardCMS\src\Orchard.Web\Core\Settings\Migrations.cs:ligne 85
--- Fin de la trace de la pile d'exception interne ---
à System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
à System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
à System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
à System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
à Orchard.Data.Migration.DataMigrationManager.Update(String feature) dans C:\Travail\OrchardCMS\src\Orchard\Data\Migration\DataMigrationManager.cs:ligne 115
I have found a workarround by starting with a SqlServer CE then droping the database with SqlCe40ToolBox.zip then restoring that database on our Sql Server instance. I then had to tweak Settings.txt in App_Data and I think I suppressed the mappings.bin also. Not so simple but it eventually does work.
I have found a workarround by starting with a SqlServer CE then droping the database with SqlCe40ToolBox.zip then restoring that database on our Sql Server instance. I then had to tweak Settings.txt in App_Data and I think I suppressed the mappings.bin also. Not so simple but it eventually does work.
I think this would mean that your SQL Server database is actually not empty and has tables that Orchard is trying to created. By using the sqlserverce temporarily you just skip the tables creation.
Can you try a different database, or try to set a custom table prefix in the setup screen to confirm this? Also what is the version of your SQL Server instance, it could be that it's not supported and some SQL statements fail.
Context : Sql Server 13.0 Windows 11 VS 2019 16.11.22 Orchard freshly cloned from https://github.com/OrchardCMS/Orchard.git Empty Database created on the server
Starting the Orchard.Web project leads to http://localhost:30321/OrchardLocal/ with the "Get Started" page. Choosing "Use an existing SQL Server, SQL Express database" and filling the "Connection string".
After validation, this error pops up in Visual Studio on line 36 of OrchardCMS\src\Orchard\Data\FetchRequest.cs : NHibernate.Exceptions.GenericADOException : 'could not execute query [ select contentpar0_.Id as Id120, contentpar1_.Id as Id131, contentfie2_.Id as Id112, contentpar0_.Name as Name120, contentpar0_.Hidden as Hidden120, contentpar0_.Settings as Settings120, contentpar1_.Name as Name131, contentpar1_.Settings as Settings131, contentpar1_.ContentFieldDefinitionRecord_id as ContentF4_131, contentpar1_.ContentPartDefinitionRecord_id as ContentP5_0, contentpar1_.Id as Id0_, contentfie2.Name as Name112 from SettingsContentPartDefinitionRecord contentpar0 left outer join SettingsContentPartFieldDefinitionRecord contentpar1 on contentpar0.Id=contentpar1.ContentPartDefinitionRecord_id left outer join SettingsContentFieldDefinitionRecord contentfie2 on contentpar1_.ContentFieldDefinitionRecordid=contentfie2.Id ] [SQL: select contentpar0_.Id as Id120, contentpar1_.Id as Id131, contentfie2_.Id as Id112, contentpar0_.Name as Name120, contentpar0_.Hidden as Hidden120, contentpar0_.Settings as Settings120, contentpar1_.Name as Name131, contentpar1_.Settings as Settings131, contentpar1_.ContentFieldDefinitionRecord_id as ContentF4_131, contentpar1_.ContentPartDefinitionRecord_id as ContentP5_0, contentpar1_.Id as Id0_, contentfie2.Name as Name112 from SettingsContentPartDefinitionRecord contentpar0 left outer join SettingsContentPartFieldDefinitionRecord contentpar1 on contentpar0.Id=contentpar1.ContentPartDefinitionRecord_id left outer join SettingsContentFieldDefinitionRecord contentfie2 on contentpar1_.ContentFieldDefinitionRecordid=contentfie2.Id]'
Then, on the "Get Started" page, another error is displayed : Setup failed: could not execute query [ select contenttyp0.Id as Id5, contenttyp0.Name as Name5 from Orchard_FrameworkContentTypeRecord contenttyp0 where contenttyp0.Name=@p0 ] Name:p1 - Value:Site [SQL: select contenttyp0.Id as Id5, contenttyp0.Name as Name5_ from Orchard_FrameworkContentTypeRecord contenttyp0 where contenttyp0_.Name=@p0]
If I look at the Database, there's only one table : Orchard_Framework_DataMigrationRecord
So Orchard had access to the database and even created a table but there is nothing there like Orchard_Framework_ContentTypeRecord or Settings_ContentPartDefinitionRecord
I'm clueless on how to fix that.
Thank you in advance for your help.