Create a new App Sample

Sorry, something has been removed with a merge. I will fix it asap.

1 Like

I have pushed the fix.

Thanks a lot, I will try it.

For some reason I am not able to create a template again.
I was working on a template and when I added it to the repository and tried to create a new app with the template it didn’t work.

I am using the last commit.

It is super hard to work with “it didn’t work”. Have you debugged it?

It’s doing the same thing, I create an app with the template, the app is created but it’s empty.
I had exported the entire app and I tried exporting only the schema to create the template but it’s the same.

I will take a look and try to see what’s wrong.

Can you give me a link to your repository? Then I can test it myself.

At the moment is this one MeloHenrique/Test (github.com) probably it’s something that I am not doing wrong because the first template I used to try the system it worked.

It is a brand new feature, I would not be surprised if you have discovered a bug.

At first I tried to replicate exactly what I did last time.
But it’s the same, I thought it could be the usage of references because the reference depends on other schemas but the first template was using it too.

It works for me:

I have configured the repositories like this




    // Tthe template repositories
    "templates": {
        "repositories": [
            {
                // The url to download readme files.
                "contentUrl": "https://raw.githubusercontent.com/Squidex/templates/main",

                // The url to the git repository.
                "gitUrl": "https://github.com/Squidex/templates.git"
            },
            {
                // The url to download readme files.
                "contentUrl": "https://raw.githubusercontent.com/MeloHenrique/test/main",

                // The url to the git repository.
                "gitUrl": "https://github.com/MeloHenrique/test.git"
            }
        ]
    }

I’ve pushed the last commited version to be sure I am up to date.
The default templates from the squidex repository work but my template creates a blank app.
I’m confused because it worked with you and I didn’t change anything.

I don’t know, can you try the latest version?

I am using the latest version. I have pushed the latest version and tested it to make sure I was using the latest version.

I will need to see what is happening and try to find any errors to start understanding what is happening in the background.

I have pushed a new version with better logs.

I’ve found out what was going on.

It looks like the cloning of the repository to the temp folder only happens the first time.

When the repository changes, it won’t be considering the new changes. That’s why you were able to use the template, and I wasn’t.

I just removed the clone from the temp folder, and it worked.

If you are stupid to use boolean expressions correctly:

:smiley:

1 Like

I have pushed the fix.

Hi,

Using the version 6.6.0 on azure the samples don’t work.
We only tested with the default ones.

When the new sample app is created it shows an error and asks to reload the page. The app is created but it’s empty.

The logs show this:

"category": "Squidex.Web.ApiExceptionFilterAttribute",
2022-04-13T10:47:01.711859729Z   "exception": {
2022-04-13T10:47:01.711864429Z     "type": "System.TypeInitializationException",
2022-04-13T10:47:01.711868329Z     "message": "The type initializer for \u0027LibGit2Sharp.Core.NativeMethods\u0027 threw an exception.",
2022-04-13T10:47:01.711872929Z     "stackTrace": "   at LibGit2Sharp.Core.NativeMethods.git_clone(git_repository*\u0026 repo, String origin_url, FilePath workdir_path, GitCloneOptions\u0026 opts)\n   at LibGit2Sharp.Core.Proxy.git_clone(String url, String workdir, GitCloneOptions\u0026 opts)\n   at LibGit2Sharp.Repository.Clone(String sourceUrl, String workdirPath, CloneOptions options)\n   at LibGit2Sharp.Repository.Clone(String sourceUrl, String workdirPath)\n   at Squidex.CLI.Commands.Implementation.FileSystem.Git.GitFileSystem.OpenAsync()\n   at Squidex.CLI.Commands.Implementation.FileSystem.FileSystems.CreateAsync(String path, DirectoryInfo workingDirectory)\n   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\n   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\n   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\n   at Squidex.Infrastructure.Commands.CustomCommandMiddlewareRunner.HandleAsync(CommandContext context, NextDelegate next) in /src/src/Squidex.Infrastructure/Commands/CustomCommandMiddlewareRunner.cs:line 26\n   at Squidex.Web.CommandMiddlewares.ETagCommandMiddleware.HandleAsync(CommandContext context, NextDelegate next) in /src/src/Squidex.Web/CommandMiddlewares/ETagCommandMiddleware.cs:line 51\n   at Squidex.Infrastructure.Commands.InMemoryCommandBus.PublishAsync(ICommand command) in /src/src/Squidex.Infrastructure/Commands/InMemoryCommandBus.cs:line 65\n   at Squidex.Areas.Api.Controllers.Apps.AppsController.InvokeCommandAsync[T](ICommand command, Func\u00602 converter) in /src/src/Squidex/Areas/Api/Controllers/Apps/AppsController.cs:line 222\n   at Squidex.Areas.Api.Controllers.Apps.AppsController.PostApp(CreateAppDto request) in /src/src/Squidex/Areas/Api/Controllers/Apps/AppsController.cs:line 120\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.\u003CInvokeActionMethodAsync\u003Eg__Logged|12_1(ControllerActionInvoker invoker)\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.\u003CInvokeNextActionFilterAsync\u003Eg__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State\u0026 next, Scope\u0026 scope, Object\u0026 state, Boolean\u0026 isCompleted)\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.\u003CInvokeInnerFilterAsync\u003Eg__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.\u003CInvokeNextExceptionFilterAsync\u003Eg__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)"
2022-04-13T10:47:01.711887929Z   }
2022-04-13T10:47:01.711891529Z }

I am not sure if this error occurs with other templates.
The last time I checked it was working but I was running it locally.

Hi, it is this problem: [SOLVED] App Templates Fail in Non-Windows environment

You have to update the the latest dev version.