Export service is not available ***

I firstly received this error in every interviewer device, when trying to create a new interview: “Failed to create interview. Reason: Activation error occurred while trying to get instance of type ICommandExecutor, key.”

Then we try to update the version of the interviewer app to 20.07.3 to get it the same with the headquarter version. The first issue was solved, but we encountered another issue of “data export”. It says “Export service is not available”

We don’t know what is the exact issue with that data export. Please kindly let us know if there are any solutions with this issue or not.

Nothing that you do with the interviewer App on the tablets affects the stability of the export service on the server. So something else must be in play, of which your description is not informative.

Run a healthcheck, see what it reports.
https://support.mysurvey.solutions/release-notes/version-20-07/

Dear Sergiy,
Thanks for your reply! Here is the Diagnostics

So it says that the export service has responded and is ok.

Where are you getting the “Export service is not available” issue then?

Dear Sergiy,

Yes. It says “Export service is not available” when we try to do data export.

Best regards,

then we tried follow by instructions :https://support.mysurvey.solutions/headquarters/config/export-service/
1 Check health on server is Healthy
2 Go to run Export service, It’s running
Yeah when go to see on Administration/Diagnostics is responded but Data export still not available.

It is the export.service log :

2020-10-07 04:12:52.527 +00:00 [ERR] Connection id "0HM3ACMHVD0AP", Request id "0HM3ACMHVD0AP:00000001": An unhandled exception was thrown by the application.
Npgsql.PostgresException (0x80004005): 3F000: no schema has been selected to create in
   at Npgsql.NpgsqlConnector.<>c__DisplayClass160_0.<<DoReadMessage>g__ReadMessageLong|0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Npgsql.NpgsqlConnector.<>c__DisplayClass160_0.<<DoReadMessage>g__ReadMessageLong|0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming)
   at Npgsql.NpgsqlCommand.ExecuteReaderAsync(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken)
   at Npgsql.NpgsqlCommand.ExecuteNonQuery(Boolean async, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQueryAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQueryAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQueryAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQueryAsync(IEnumerable`1 migrationCommands, IRelationalConnection connection, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQueryAsync(IEnumerable`1 migrationCommands, IRelationalConnection connection, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQueryAsync(IEnumerable`1 migrationCommands, IRelationalConnection connection, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQueryAsync(IEnumerable`1 migrationCommands, IRelationalConnection connection, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.MigrateAsync(String targetMigration, CancellationToken cancellationToken)
   at WB.Services.Export.Infrastructure.TenantDbContext.CheckSchemaVersionAndMigrate(CancellationToken cancellationToken)
   at WB.Services.Export.Infrastructure.TenantDbContext.EnsureMigrated(CancellationToken cancellationToken)
   at WB.Services.Export.Host.Jobs.PostgresDataExportProcessesService.GetAllProcessesAsync(Boolean runningOnly, CancellationToken token)
   at WB.Services.Export.Host.Controllers.JobController.GetAllJobsList(CancellationToken token)
   at lambda_method(Closure , Object )
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   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>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
  Exception data:
    Severity: ERROR
    SqlState: 3F000
    MessageText: no schema has been selected to create in
    Position: 14
    File: namespace.c
    Line: 494
    Routine: RangeVarGetCreationNamespace

Please don’t crop screenshots so that we don’t see version of headquarters application.
From postgresql error, is there public schema is present in survey solutions database?

Fullscreen

Can you guide me about Public schema, I think I was wrong about Postgresql. I just to connecting on SQL Workbench :


This result Connected to the database

Unfortunately I’m not familiar with SQL Workbench application. What is needed is that schema named public existed in database that is used by Survey Solutions export service. Please try to restart export service from services window and see if it works.

What does health check of export service itself reports, if you open http://localhost:5000/.hc?

It might be easier for you to upgrade to 20.09 version of the application since it does not use external service to host export.

What is needed is that schema named public existed in database that is used by Survey Solutions export service. Please try to restart export service from services window and see if it works.
Replied : I was restart again and again. It works normally and health check of export service itself reports:

After upgrade Headquarters version to 20.09.1 yeah it shows that :

Uploading: IMG_20201007_203706_401.jpg…

Then I went to export data (tab and stata) but it’s just loading!IMG_20201007_203708_458|690x337

After loading it’s still not available

How about this issue?

Please send full log files to support email. Also we are still not sure if default schema exists in the database.

You can try using dbeaver application in order to connect to database server and see a list of created schemas

While connected to survey solutions database what does the following query outputs
SHOW search_path; ?

Also, as a test, could you please try changing the database name in connection string to SurveySolutions1, just to check how application works on clean database?

Please send full log files to support email. Also we are still not sure if default schema exists in the database.

You can try using dbeaver application in order to connect to database server and see a list of created schemas

While connected to survey solutions database what does the following query outputs
SHOW search_path; ?

I sent it to support already but version 20.09 have no Export services folder right?
I checked on my other server C:\Survey Solutions it has no this folder anymore when we finished update version to 20.09

Also, as a test, could you please try changing the database name in connection string to SurveySolutions1, just to check how application works on clean database?
Yeah it changed,

Yes. It is what is needed. Register, import any questionnaire and try export, is it working ?

Hello Survey Solutions team,
I have been unable to export the data collected.

Error:
“Failed to create interview. Reason: Activation error occurred while trying to get instance of type ICommandExecutor, key.”

Then I updated the Survey Solutions instance server version from 20.07.02 to 20.07.03 and updated the interviewer app to 20.07.3 the same with the headquarter version.
The first issue was solved, but we encountered another issue of “Data export”.
It says “Export service is not available”

Administration/Diagnostics shows us the following:

then I did change the connection string to the database and executing iisreset command service is restarted.
image

Issue is export service still not available, I followed instructions https://support.mysurvey.solutions/headquarters/config/export-service/ and it look like has no problems
First one with http://localhost:5000/.hc : Healthy
Second running export services :

I checked the appsettings.production,
Site:

Export services

export-service LOG :

2020-10-07 03:37:46.678 +00:00 [ERR] Connection id "0HM3ACMHVCV05", Request id "0HM3ACMHVCV05:00000001": An unhandled exception was thrown by the application.
Npgsql.PostgresException (0x80004005): 3F000: no schema has been selected to create in
   at Npgsql.NpgsqlConnector.<>c__DisplayClass160_0.<<DoReadMessage>g__ReadMessageLong|0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Npgsql.NpgsqlConnector.<>c__DisplayClass160_0.<<DoReadMessage>g__ReadMessageLong|0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming)
   at Npgsql.NpgsqlCommand.ExecuteReaderAsync(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken)
   at Npgsql.NpgsqlCommand.ExecuteNonQuery(Boolean async, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQueryAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQueryAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQueryAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQueryAsync(IEnumerable`1 migrationCommands, IRelationalConnection connection, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQueryAsync(IEnumerable`1 migrationCommands, IRelationalConnection connection, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQueryAsync(IEnumerable`1 migrationCommands, IRelationalConnection connection, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQueryAsync(IEnumerable`1 migrationCommands, IRelationalConnection connection, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.MigrateAsync(String targetMigration, CancellationToken cancellationToken)
   at WB.Services.Export.Infrastructure.TenantDbContext.CheckSchemaVersionAndMigrate(CancellationToken cancellationToken)
   at WB.Services.Export.Infrastructure.TenantDbContext.EnsureMigrated(CancellationToken cancellationToken)
   at WB.Services.Export.Host.Jobs.PostgresDataExportProcessesService.GetAllProcessesAsync(Boolean runningOnly, CancellationToken token)
   at WB.Services.Export.Host.Controllers.JobController.GetAllJobsList(CancellationToken token)
   at lambda_method(Closure , Object )
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   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>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
  Exception data:
    Severity: ERROR
    SqlState: 3F000
    MessageText: no schema has been selected to create in
    Position: 14
    File: namespace.c
    Line: 494
    Routine: RangeVarGetCreationNamespace

Do you see something irregular? I would like to understand what is failing.
I don’t know what is the exact issue with that data export. Please kindly let us know if there are any solutions with this issue.
Thanks,
Meychou.

The issue was in wrong configuration. Important configuration TenantName was removed by mistake that caused an issue.

1 Like