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

Bug: Exception when loading Devices Configurations #2221

Closed
hocinehacherouf opened this issue Jun 16, 2023 · 1 comment
Closed

Bug: Exception when loading Devices Configurations #2221

hocinehacherouf opened this issue Jun 16, 2023 · 1 comment
Assignees
Labels
aws bug Something isn't working

Comments

@hocinehacherouf
Copy link
Contributor

On AWS mode, when loading Devices Configurations an exception is thrown because the implementation of IDeviceConfigurationsService is not defined.

Logs

{
  "TraceId": "00-166e8e66b41d1d323b4cdf6cfa9b9776-e6bb2fe959e27cf7-00",
  "ExceptionDetails": [
    {
      "Message": "Unable to resolve service for type 'IoTHub.Portal.Application.Services.IDeviceConfigurationsService' while attempting to activate 'IoTHub.Portal.Server.Controllers.v10.DeviceConfigurationsController'.",
      "Type": "System.InvalidOperationException",
      "Raw": "System.InvalidOperationException: Unable to resolve service for type 'IoTHub.Portal.Application.Services.IDeviceConfigurationsService' while attempting to activate 'IoTHub.Portal.Server.Controllers.v10.DeviceConfigurationsController'.\r\n   at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.GetService(IServiceProvider sp, Type type, Type requiredBy, Boolean isDefaultParameterRequired)\r\n   at lambda_method654(Closure, IServiceProvider, Object[])\r\n   at Microsoft.AspNetCore.Mvc.Controllers.ControllerFactoryProvider.<>c__DisplayClass6_0.<CreateControllerFactory>g__CreateController|0(ControllerContext controllerContext)\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()\r\n--- End of stack trace from previous location ---\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()\r\n--- End of stack trace from previous location ---\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)\r\n   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)\r\n   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)\r\n   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)\r\n   at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)\r\n   at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)\r\n   at NetEscapades.AspNetCore.SecurityHeaders.SecurityHeadersMiddleware.Invoke(HttpContext context) in /_/src/NetEscapades.AspNetCore.SecurityHeaders/SecurityHeadersMiddleware.cs:line 69\r\n   at Hellang.Middleware.ProblemDetails.ProblemDetailsMiddleware.Invoke(HttpContext context)",
      "StackFrames": [
        {
          "FilePath": null,
          "FileName": null,
          "Function": "Microsoft.Extensions.DependencyInjection.ActivatorUtilities.GetService(IServiceProvider sp, Type type, Type requiredBy, bool isDefaultParameterRequired)",
          "Line": null,
          "PreContextLine": null,
          "PreContextCode": null,
          "ContextCode": null,
          "PostContextCode": null
        },
        {
          "FilePath": null,
          "FileName": null,
          "Function": "lambda_method654(Closure , IServiceProvider , object[] )",
          "Line": null,
          "PreContextLine": null,
          "PreContextCode": null,
          "ContextCode": null,
          "PostContextCode": null
        },
        {
          "FilePath": null,
          "FileName": null,
          "Function": "Microsoft.AspNetCore.Mvc.Controllers.ControllerFactoryProvider+<>c__DisplayClass6_0.<CreateControllerFactory>g__CreateController|0(ControllerContext controllerContext)",
          "Line": null,
          "PreContextLine": null,
          "PreContextCode": null,
          "ContextCode": null,
          "PostContextCode": null
        },
        {
          "FilePath": null,
          "FileName": null,
          "Function": "Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted)",
          "Line": null,
          "PreContextLine": null,
          "PreContextCode": null,
          "ContextCode": null,
          "PostContextCode": null
        },
        {
          "FilePath": null,
          "FileName": null,
          "Function": "Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()",
          "Line": null,
          "PreContextLine": null,
          "PreContextCode": null,
          "ContextCode": null,
          "PostContextCode": null
        },
        {
          "FilePath": null,
          "FileName": null,
          "Function": "Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted)",
          "Line": null,
          "PreContextLine": null,
          "PreContextCode": null,
          "ContextCode": null,
          "PostContextCode": null
        },
        {
          "FilePath": null,
          "FileName": null,
          "Function": "Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)",
          "Line": null,
          "PreContextLine": null,
          "PreContextCode": null,
          "ContextCode": null,
          "PostContextCode": null
        },
        {
          "FilePath": null,
          "FileName": null,
          "Function": "Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted)",
          "Line": null,
          "PreContextLine": null,
          "PreContextCode": null,
          "ContextCode": null,
          "PostContextCode": null
        },
        {
          "FilePath": null,
          "FileName": null,
          "Function": "Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()",
          "Line": null,
          "PreContextLine": null,
          "PreContextCode": null,
          "ContextCode": null,
          "PostContextCode": null
        },
        {
          "FilePath": null,
          "FileName": null,
          "Function": "Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)",
          "Line": null,
          "PreContextLine": null,
          "PreContextCode": null,
          "ContextCode": null,
          "PostContextCode": null
        },
        {
          "FilePath": null,
          "FileName": null,
          "Function": "Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)",
          "Line": null,
          "PreContextLine": null,
          "PreContextCode": null,
          "ContextCode": null,
          "PostContextCode": null
        },
        {
          "FilePath": null,
          "FileName": null,
          "Function": "Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)",
          "Line": null,
          "PreContextLine": null,
          "PreContextCode": null,
          "ContextCode": null,
          "PostContextCode": null
        },
        {
          "FilePath": null,
          "FileName": null,
          "Function": "Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)",
          "Line": null,
          "PreContextLine": null,
          "PreContextCode": null,
          "ContextCode": null,
          "PostContextCode": null
        },
        {
          "FilePath": null,
          "FileName": null,
          "Function": "Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)",
          "Line": null,
          "PreContextLine": null,
          "PreContextCode": null,
          "ContextCode": null,
          "PostContextCode": null
        },
        {
          "FilePath": null,
          "FileName": null,
          "Function": "Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)",
          "Line": null,
          "PreContextLine": null,
          "PreContextCode": null,
          "ContextCode": null,
          "PostContextCode": null
        },
        {
          "FilePath": null,
          "FileName": null,
          "Function": "Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)",
          "Line": null,
          "PreContextLine": null,
          "PreContextCode": null,
          "ContextCode": null,
          "PostContextCode": null
        },
        {
          "FilePath": "/_/src/NetEscapades.AspNetCore.SecurityHeaders/SecurityHeadersMiddleware.cs",
          "FileName": "SecurityHeadersMiddleware.cs",
          "Function": "NetEscapades.AspNetCore.SecurityHeaders.SecurityHeadersMiddleware.Invoke(HttpContext context)",
          "Line": 69,
          "PreContextLine": null,
          "PreContextCode": null,
          "ContextCode": null,
          "PostContextCode": null
        },
        {
          "FilePath": null,
          "FileName": null,
          "Function": "Hellang.Middleware.ProblemDetails.ProblemDetailsMiddleware.Invoke(HttpContext context)",
          "Line": null,
          "PreContextLine": null,
          "PreContextCode": null,
          "ContextCode": null,
          "PostContextCode": null
        }
      ]
    }
  ],
  "type": "https://httpstatuses.io/500",
  "title": "Internal Server Error",
  "status": 500,
  "detail": "Unable to resolve service for type 'IoTHub.Portal.Application.Services.IDeviceConfigurationsService' while attempting to activate 'IoTHub.Portal.Server.Controllers.v10.DeviceConfigurationsController'."
}

Additional Information

@kbeaugrand
Copy link
Member

@ssgueye2, please hide this menu item on then client for AWS cloud provider.

@kbeaugrand kbeaugrand moved this from 📝 Todo to 🚀 Ready in IoT Hub Portal Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws bug Something isn't working
Projects
Status: 🚀 Ready
Development

No branches or pull requests

3 participants