[SOLVED] App Templates Fail in Non-Windows environment

I have…

I’m submitting a…

  • [ ] Regression (a behavior that stopped working in a new release)

  • [x] Bug report

  • [ ] Performance issue

  • [ ] Documentation issue or request

Current behavior

When clicking on either of the current app templates (Starter Sample Blog, Starter Sample Profile), filling out the app name, hitting create, I get an error Failed to create app. Please reload..

The app gets created as expected, but the template fails to apply.

Logs show that it’s failing in


{

  message: 'The type initializer for ''LibGit2Sharp.Core.NativeMethods'' threw an exception.',

  stackTrace: '   at LibGit2Sharp.Core.NativeMethods.git_clone(git_repository*& repo, String origin_url, FilePath workdir_path, GitCloneOptions& opts)

   at LibGit2Sharp.Core.Proxy.git_clone(String url, String workdir, GitCloneOptions& opts)

   at LibGit2Sharp.Repository.Clone(String sourceUrl, String workdirPath, CloneOptions options)

   at LibGit2Sharp.Repository.Clone(String sourceUrl, String workdirPath)

   at Squidex.CLI.Commands.Implementation.FileSystem.Git.GitFileSystem.OpenAsync()

   at Squidex.CLI.Commands.Implementation.FileSystem.FileSystems.CreateAsync(String path, DirectoryInfo workingDirectory)

   at Squidex.Domain.Apps.Entities.Apps.Templates.TemplateCommandMiddleware.CreateSyncServiceAsync(String repository, ISession session) in /src/src/Squidex.Domain.Apps.Entities/Apps/Templates/TemplateCommandMiddleware.cs:line 96

   at Squidex.Domain.Apps.Entities.Apps.Templates.TemplateCommandMiddleware.ApplyTemplateAsync(IAppEntity app, String template) in /src/src/Squidex.Domain.Apps.Entities/Apps/Templates/TemplateCommandMiddleware.cs:line 74

   at Squidex.Domain.Apps.Entities.Apps.Templates.TemplateCommandMiddleware.HandleAsync(CommandContext context, NextDelegate next) in /src/src/Squidex.Domain.Apps.Entities/Apps/Templates/TemplateCommandMiddleware.cs:line 49

   at Squidex.Infrastructure.Commands.CustomCommandMiddlewareRunner.HandleAsync(CommandContext context, NextDelegate next) in /src/src/Squidex.Infrastructure/Commands/CustomCommandMiddlewareRunner.cs:line 26

   at Squidex.Web.CommandMiddlewares.ETagCommandMiddleware.HandleAsync(CommandContext context, NextDelegate next) in /src/src/Squidex.Web/CommandMiddlewares/ETagCommandMiddleware.cs:line 51

   at Squidex.Infrastructure.Commands.InMemoryCommandBus.PublishAsync(ICommand command) in /src/src/Squidex.Infrastructure/Commands/InMemoryCommandBus.cs:line 65

   at Squidex.Areas.Api.Controllers.Apps.AppsController.InvokeCommandAsync[T](ICommand command, Func`2 converter) in /src/src/Squidex/Areas/Api/Controllers/Apps/AppsController.cs:line 222

   at Squidex.Areas.Api.Controllers.Apps.AppsController.PostApp(CreateAppDto request) in /src/src/Squidex/Areas/Api/Controllers/Apps/AppsController.cs:line 120

   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)

   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Logged|12_1(ControllerActionInvoker invoker)

   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.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)',

  type: 'System.TypeInitializationException'

}

Expected behavior

The clone works without exception

Minimal reproduction of the problem

I run a custom docker-compose which builds the current master.

Environment

App Name: any

  • [x] Self hosted with docker

  • [ ] Self hosted with IIS

  • [ ] Self hosted with other version

  • [ ] Cloud version

Version: [VERSION]

Browser:

  • [x] Chrome (desktop)

  • [ ] Chrome (Android)

  • [ ] Chrome (iOS)

  • [ ] Firefox

  • [ ] Safari (desktop)

  • [ ] Safari (iOS)

  • [ ] IE

  • [ ] Edge

Others:

The libgit2sharp issues suggest the new preview releases may have solved the issue.

Where have you seen that?

You are right. An update seems to fix the problem.

I’ve confirmed the update works on my end as well. Thank you for the quick response and solution.

1 Like

This topic was automatically closed after 2 days. New replies are no longer allowed.