hargata / lubelog

LubeLogger is a web-based vehicle maintenance and fuel mileage tracker
https://lubelogger.com
MIT License
1.15k stars 59 forks source link

Error: ASPNETCORE_ENVIRONMENT in development mode? #235

Closed alternativesurfer closed 8 months ago

alternativesurfer commented 9 months ago

If I try and pull up the lubelogger dash I see this error.

image

hargata commented 9 months ago

do you have any errors in your console?

alternativesurfer commented 9 months ago

Looks like it image

Attaching to app-1 app-1 | fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1] app-1 | An unhandled exception has occurred while executing the request. app-1 | System.UnauthorizedAccessException: Access to the path '/App/data/cartrac ker.db' is denied. app-1 | ---> System.IO.IOException: Permission denied app-1 | --- End of inner exception stack trace --- app-1 | at System.IO.RandomAccess.WriteAtOffset(SafeFileHandle handle, ReadOnl ySpan1 buffer, Int64 fileOffset) app-1 | at System.IO.Strategies.OSFileStreamStrategy.Write(ReadOnlySpan1 buff er) app-1 | at System.IO.Strategies.BufferedFileStreamStrategy.WriteSpan(ReadOnlyS pan1 source, ArraySegment1 arraySegment) app-1 | at System.IO.Strategies.BufferedFileStreamStrategy.Write(Byte[] buffer , Int32 offset, Int32 count) app-1 | at LiteDB.Engine.DiskService.Write(IEnumerable`1 pages, FileOrigin ori gin) app-1 | at LiteDB.Engine.WalIndexService.CheckpointInternal() app-1 | at LiteDB.Engine.WalIndexService.TryCheckpoint() app-1 | at LiteDB.Engine.LiteEngine.Dispose(Boolean disposing) app-1 | at LiteDB.Engine.LiteEngine.Dispose() app-1 | at LiteDB.LiteDatabase.Dispose(Boolean disposing) app-1 | at LiteDB.LiteDatabase.Dispose() app-1 | at CarCareTracker.External.Implementations.VehicleDataAccess.GetVehicl es() in /App/External/Implementations/VehicleDataAccess.cs:line 34 app-1 | at CarCareTracker.Controllers.HomeController.Garage() in /App/Controll ers/HomeController.cs:line 43 app-1 | at lambda_method25(Closure, Object, Object[]) app-1 | at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncAc tionResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) app-1 | at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Inv okeActionMethodAsync() app-1 | at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Nex t(State& next, Scope& scope, Object& state, Boolean& isCompleted) app-1 | at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Inv okeNextActionFilterAsync() app-1 | --- End of stack trace from previous location --- app-1 | at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Ret hrow(ActionExecutedContextSealed context) app-1 | at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Nex t(State& next, Scope& scope, Object& state, Boolean& isCompleted) app-1 | at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Inv okeInnerFilterAsync() app-1 | --- End of stack trace from previous location --- app-1 | at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.gAwaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) app-1 | at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(Res ourceExecutedContextSealed context) app-1 | at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) app-1 | at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilte rPipelineAsync() app-1 | --- End of stack trace from previous location --- app-1 | at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) app-1 | at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.gAwaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) app-1 | at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(H ttpContext context) app-1 | at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.g__Awaited|10_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Tas k task)

`

hargata commented 9 months ago

seems like your docker container didn't mount the volume /data/ correctly. Can you re-check your docker-compose?

alternativesurfer commented 9 months ago

Checking it now. Nothing changed between yesterday and today (when it was working) But I am going to rewrite it so Data is on the local VM rather than a mount.

hargata commented 9 months ago

@alternativesurfer kk let me know if that worked, this seems more like a setup/configuration issue.

alternativesurfer commented 9 months ago

I am going to rebuild the whole thing After updating my mapping for the volumes the Restore feature broke.

Ill check in after I get it back up

hargata commented 9 months ago

@alternativesurfer any chance you might be mapping the temp volume to the same directory as other volumes? see #128

alternativesurfer commented 9 months ago

I wish it were that simple:

  - /home/lubelogger/lubelogger-app/config:/App/config
  - /mnt/media/lubelogger/data:/App/data
  - /home/lubelogger/lubelogger-app/translations:/App/wwwroot/translations
  - /mnt/media/lubelogger/documents:/App/wwwroot/documents
  - /mnt/media/lubelogger/images:/App/wwwroot/images
  - /home/lubelogger/lubelogger-app/temp:/App/wwwroot/temp
  - /home/lubelogger/lubelogger-app/log:/App/log
  - /home/lubelogger/lubelogger-app/keys:/root/.aspnet/DataProtection-Keys

Sorry on the delay. Rebuilding today, ran out of bandwidth yesteday.

alternativesurfer commented 8 months ago

Rebuilt and this no longer is occurring. closing