[SOLVED] Importing a CSV file is generating error "The handle is invalid"

Im currently getting the below error when trying to import a CSV file. Importing the Schena works fine (credentials are all ok)

----------ERROR ----
ERROR: System.IO.IOException: The handle is invalid.
May 5th 2022 10:07:24 Info at System.ConsolePal.GetBufferInfo(Boolean throwOnNoConsole, Boolean& succeeded) May 5th 2022 10:07:24 Info at System.ConsolePal.GetCursorPosition() May 5th 2022 10:07:24 Info at System.Console.get_CursorTop() May 5th 2022 10:07:24 Info at Squidex.CLI.Commands.Implementation.ConsoleLogger.ConsoleLine…ctor() May 5th 2022 10:07:24
Info at Squidex.CLI.Commands.Implementation.ConsoleLogger.WriteSameLine() May 5th 2022 10:07:24 Info at Squidex.CLI.Commands.Implementation.ImExport.ImportHelper.ImportAsync(ISession session, IImportSettings setting, ILogger log, IEnumerable`1 datas) May 5th 2022 10:07:24 Info at Squidex.CLI.Commands.App.Content.Import(ImportArguments arguments) May 5th 2022 10:07:24
Info at Squidex.CLI.Commands.App.Content.Import(ImportArguments arguments) May 5th 2022 10:07:24 Info at CommandDotNet.Execution.InvocationResultExtensions.GetResultCodeAsync(Object value) May 5th 2022 10:07:24 Info at CommandDotNet.AppRunner.HandleException(Exception ex, IConsole console, CommandContext commandContext) May 5th 2022 10:07:24 Info at CommandDotNet.AppRunner.Run(String[] args) May 5th 2022 10:07:24 Info at Squidex.CLI.Program.Main(String[] args) May 5th 2022 10:07:24 Info Completed Squidex Data Migrations

----------------CSV CONTENT-------------
FullName,DataOwner,Purpose
TestFullName,TestDataOwner,TestPurpose

--------------------POWERSHELL SCRIPT------------------------------------
$currentLocation = Get-Location
$squidex_client_id = “myappname:default”
$squidex_app_name = “myappname”
$squidex_client_secret = “xxxxxxxxxxxxxxxxxxxxxxxx”
$squidex_app_url = “https://this.is.not.real.com/”

& .\sq.exe config add $squidex_app_name $squidex_client_id $squidex_client_secret -u $squidex_app_url
& .\sq.exe schemas sync schemas\myschema.json
& .\sq.exe content import schemaName $currentLocation\data\mycontent.csv --fields=FullName,DataOwner,Purpose --format=CSV --delimiter=’,’


What operation system do you use? Or do you forward the console to a pipe?

EDIT: Stupid question, you mentioned powershell.

I have fixed it: A new version is in the CI pipeline and should land on github soon.

Fantastic that worked. Thank you for your help.

1 Like

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