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

Survey install incomplete when using non MS SQL database #7

Closed
ghhv opened this issue Mar 4, 2022 · 10 comments · Fixed by #10
Closed

Survey install incomplete when using non MS SQL database #7

ghhv opened this issue Mar 4, 2022 · 10 comments · Fixed by #10

Comments

@ghhv
Copy link

ghhv commented Mar 4, 2022

I'm testing Oqtane and whilst I was able to download and install Survey seemingly successfully with both MS LocalDb and Postgres but when trying to add the module to page with the Postgres install, I get the following:

`fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1]
An unhandled exception has occurred while executing the request.
Npgsql.PostgresException (0x80004005): 42P01: relation "oqtane_survey" does not exist

  POSITION: 406
     at Npgsql.Internal.NpgsqlConnector.<ReadMessage>g__ReadMessageLong|213_0(NpgsqlConnector connector, Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, Boolean isReadingPrependedMessage)
     at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken)
     at Npgsql.NpgsqlDataReader.NextResult()
     at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken)
     at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken)
     at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior)
     at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReader(RelationalCommandParameterObject parameterObject)
     at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.Enumerator.InitializeReader(Enumerator enumerator)
     at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
     at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.Enumerator.MoveNext()
     at System.Linq.Enumerable.TryGetSingle[TSource](IEnumerable`1 source, Boolean& found)
     at lambda_method2376(Closure , QueryContext )
     at System.Linq.Queryable.FirstOrDefault[TSource](IQueryable`1 source)
     at Oqtane.Survey.Repository.SurveyRepository.GetSurvey(Int32 Id) in C:\Users\Michael\Source\Repos\ADefWebserver\Oqtane.Survey\Server\Repository\SurveyRepository.cs:line 55
     at Oqtane.Survey.Controllers.SurveyController.Get(Int32 id) in C:\Users\Michael\Source\Repos\ADefWebserver\Oqtane.Survey\Server\Controllers\SurveyController.cs:line 50
     at lambda_method2315(Closure , Object , Object[] )
     at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
     at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
     at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
     at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()
  --- End of stack trace from previous location ---
     at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
     at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
     at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
  --- End of stack trace from previous location ---
     at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
     at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
     at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
     at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
  --- End of stack trace from previous location ---
     at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
     at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
     at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
     at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
     at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
     at Microsoft.AspNetCore.Authorization.Policy.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult)
     at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
     at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
     at Oqtane.Infrastructure.TenantMiddleware.Invoke(HttpContext context) in C:\Data\git\Equiprove\Oqtane\Oqtane.Server\Infrastructure\Middleware\TenantMiddleware.cs:line 37
     at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context)
     at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
    Exception data:
      Severity: ERROR
      SqlState: 42P01
      MessageText: relation "oqtane_survey" does not exist
      Position: 406
      File: d:\pginstaller_12.auto\postgres.windows-x64\src\backend\parser\parse_relation.c
      Line: 1194
      Routine: parserOpenTable`

This maybe related to another error I've discovered during startup for which I'll log an issue under the framework.

Cannot write DateTime with Kind=Unspecified to PostgreSQL type 'timestamp with time zone', only UTC is supported

@ghhv
Copy link
Author

ghhv commented Mar 4, 2022

if related, here's the DateTime issue mentioned above - oqtane/oqtane.framework#2038

@ghhv
Copy link
Author

ghhv commented Mar 4, 2022

Trying again on a fresh Oqtane install - Survey module is installed
image
image
image
image
Error occurs in backend when clicking Add Survey on front end after module installed on page.
image
this is what appears on front end post back end error
image

@ghhv
Copy link
Author

ghhv commented Mar 4, 2022

full server log:
oqtane_survey_postgres_fail_full_server.log

@ghhv
Copy link
Author

ghhv commented Mar 4, 2022

Comparing tables between the local MS SQL database and Postgres, none of these have been created in Postgres
image
Postgres
image

@sbwalker
Copy link
Member

sbwalker commented Mar 4, 2022

This module was created before support for multiple databases was added to the framework. As a result it currently only supports SQL Server. You can see the scripts it uses in this folder: https://github.com/oqtane/Oqtane.Survey/tree/main/Server/Scripts. I am not sure if @ADefWebserver intends on upgrading it to use Migrations or not.

@ghhv
Copy link
Author

ghhv commented Mar 4, 2022

hi Shaun, yes, I did wonder that after I heard on one of your videos today that the multi-db support was now using migrations. Thanks.

@ADefWebserver
Copy link
Member

I will work on a updated version over the next few weeks.

@ADefWebserver
Copy link
Member

@sbwalker - I have done everything I can to get this working but I am totally stuck :( - The database wont create unless you first upload the module, then click the upgrade button. Then the Radzen JavaScript wont display (I think this is related to this issue). I posted the version on this branch.

@sbwalker
Copy link
Member

sbwalker commented Mar 7, 2022

@ADefWebserver are you saying that you are trying to upgrade the module to use Migrations rather than SQL scripts and you are running into difficulty? And in addition, you are running into a JavaScript loading issue?

@ADefWebserver
Copy link
Member

@sbwalker - I created a new issue here: #8 any help would be appreciated. I am stuck 🙁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants