[FIXED] Error sync out using the CLI in content

I have…

I’m submitting a…

  • [ ] Regression (a behavior that stopped working in a new release)
  • [ ] Bug report
  • [ ] Performance issue
  • [x] Documentation issue or request

Current behavior

When trying to sync out our content from one application to another we are facing the following issue.

if I use “sq export <schema_name> --format=JSON” I got the file but when I import it into the other app I have the following error:

ERROR: Singleton content cannot be created.
HTTP Response:
Squidex.ClientLibrary.Management.SquidexManagementException`1[Squidex.ClientLibrary.Management.ErrorDto]: Singleton content cannot be created

in the other hand, trying to sync out all our contents (as we have many to go one-by-one) using “sq sync out -t contents <folder_name>” I have this other error

Exporting admin (0)… succeeded.
ERROR: Squidex.ClientLibrary.SquidexException: The app, schema or entity does not exist.
at Squidex.ClientLibrary.Utils.SquidexClientBase.EnsureResponseIsValidAsync(HttpResponseMessage response) in /home/fmac/hackerman/github/squidex-samples/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary/Utils/SquidexClientBase.cs:line 106

Expected behavior

We were expecting to migrate all the content from one application to another as they will belong to different environments of the application

Minimal reproduction of the problem

Environment

App Name: oral-surgery-cms and oral-surgery-prod

  • [ ] Self hosted with docker
  • [ ] Self hosted with IIS
  • [ ] Self hosted with other version
  • [x] Cloud version

The first error is not a bug. the import is just not created for singletons, because it create new content items.

The second error could be a permission problem. Can you give your client owner permission and also post the full output here?

Hi Sebastian,

Regarding the permissions. Currently I am using the CLI from my computer but there is only one contributor (the main account) which is the owner. Do I need to provide credentials using the CLI?
Also, I can export the first two contents, it fails when going through the third one of the list

Regards,
Fernando.

The client is also has a role.
Please provide your full logs. Is the third one the singleton?

I tested it locally and it worked fine.

Hi Seastian,

Here the full log. I couldn’t tell if the third one is the singleton.

❯ sq sync out -t contents os_old_backup
Synchronizing app:‘oral-surgery-cms’ -> /home/fmac/os_old_backup

Executing the following steps

  • STEP 0 of 1: Contents

  • STEP 0 of 1: Exporting Contents started

Exporting aboutus (0)… succeeded.
Exporting admin (0)… succeeded.
ERROR: Squidex.ClientLibrary.SquidexException: The app, schema or entity does not exist.
at Squidex.ClientLibrary.Utils.SquidexClientBase.EnsureResponseIsValidAsync(HttpResponseMessage response) in /home/fmac/hackerman/github/squidex-samples/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary/Utils/SquidexClientBase.cs:line 106
at Squidex.ClientLibrary.Utils.SquidexClientBase.RequestJsonAsync[T](HttpMethod method, String path, HttpContent content, QueryContext context, CancellationToken ct) in /home/fmac/hackerman/github/squidex-samples/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary/Utils/SquidexClientBase.cs:line 77
at Squidex.ClientLibrary.ContentsClient2.GetAllAsync(Func2 callback, Int32 batchSize, QueryContext context, CancellationToken ct) in /home/fmac/hackerman/github/squidex-samples/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary/ContentsClient.cs:line 58
at Squidex.CLI.Commands.Implementation.Sync.Contents.ContentsSynchronizer.ExportAsync(ISyncService sync, SyncOptions options, ISession session) in /home/fmac/hackerman/github/squidex-samples/cli/Squidex.CLI/Squidex.CLI.Core/Commands/Implementation/Sync/Contents/ContentsSynchronizer.cs:line 67
at Squidex.CLI.Commands.Implementation.Sync.Synchronizer.<>c__DisplayClass5_0.<b__0>d.MoveNext() in /home/fmac/hackerman/github/squidex-samples/cli/Squidex.CLI/Squidex.CLI.Core/Commands/Implementation/Sync/Synchronizer.cs:line 106
— End of stack trace from previous location —
at Squidex.CLI.Commands.Implementation.Utils.Extensions.Foreach[T](IEnumerable1 source, Func3 action) in /home/fmac/hackerman/github/squidex-samples/cli/Squidex.CLI/Squidex.CLI.Core/Commands/Implementation/Utils/Extensions.cs:line 53
at Squidex.CLI.Commands.Implementation.Sync.Synchronizer.ExportAsync(String path, SyncOptions options, ISession session) in /home/fmac/hackerman/github/squidex-samples/cli/Squidex.CLI/Squidex.CLI.Core/Commands/Implementation/Sync/Synchronizer.cs:line 98
at Squidex.CLI.Commands.App.Sync.Out(OutArguments arguments) in /home/fmac/hackerman/github/squidex-samples/cli/Squidex.CLI/Squidex.CLI/Commands/App_Sync.cs:line 52
at CommandDotNet.Execution.InvocationResultExtensions.GetResultCodeAsync(Object value) in CommandDotNet/Execution/InvocationResultExtensions.cs:line 15
at CommandDotNet.AppRunner.HandleException(Exception ex, CommandContext commandContext) in CommandDotNet/AppRunner.cs:line 185
at CommandDotNet.AppRunner.Run(String[] args) in CommandDotNet/AppRunner.cs:line 95
at Squidex.CLI.Program.Main(String[] args) in /home/fmac/hackerman/github/squidex-samples/cli/Squidex.CLI/Squidex.CLI/Program.cs:line 57

Yes, it is the singleton

I cannot reproduce it. But I can try with you apps tomorrow if this is okay for you.

Sure thing, feel free

1 Like

Hi Sebastian,

Here the list of the contents we cannot migrate automatically

  • coursedetails
  • coursegallery
  • createeditcourse
  • drawer
  • forumpost
  • homepage
  • magazines
  • privacypolicy
  • promocodes
  • signup
  • subscriptions

Regards,
Fernando.

I can reproduce it. The CLI crashs when the schema is not published.

I have deployed a new version of the CLI, that fixes that.

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