autorest icon indicating copy to clipboard operation
autorest copied to clipboard

AutoRest failed with vscode-jsonrpc error: Message header must separate key and value using

Open bangbingsyb opened this issue 5 years ago • 3 comments

Describe the bug

Please provide as much information as you can. This would be: 
- OpenAPI files having the issues: the sample pets.json provided by autorest tutorial (https://raw.githubusercontent.com/Azure/autorest/master/docs/openapi/examples/pets.json)
- Autorest command used: autorest --input-file=pets.json --csharp --output-folder=sdk/ --namespace=pets

Expected behavior Autorest runs successfully and generates the client for the sample API.

Additional context I tried nodejs v12, v14, v15 and autorest all failed with the same error - not sure if it has anything to do with my setup?

Error:

autorest --input-file=pets.json --csharp --output-folder=sdk/ --namespace=pets AutoRest code generation utility [cli version: 3.0.6339; node: v12.20.2, max-memory: 2048 MB] (C) 2018 Microsoft Corporation. https://aka.ms/autorest NOTE: AutoRest core version selected from configuration: ~3.0.6298. Loading AutoRest core 'C:\Users\yashi.autorest@[email protected]\node_modules@autorest\core\dist' (3.0.6373) Loading AutoRest extension '@autorest/csharp' (latest->3.0.0-beta.20210211.1) Loading AutoRest extension '@autorest/modelerfour' (4.15.456->4.15.456) Unknown option: --roll-forward

C:\Users\yashi.autorest@[email protected]\node_modules@autorest\core\dist\vendors-common_temp_node_modules_pnpm_azure-tools_extension_3_1_272_node_modules_azure-tools_-78c196.js:85719 headers.forEach(function (header) { ^ Error: Message header must separate key and value using : at C:\Users\yashi.autorest@[email protected]\node_modules@autorest\core\dist\vendors-common_temp_node_modules_pnpm_azure-tools_extension_3_1_272_node_modules_azure-tools_-78c196.js:85722:23 at Array.forEach () at MessageBuffer.exports.modules.../../../common/temp/node_modules/.pnpm/[email protected]/node_modules/vscode-jsonrpc/lib/messageReader.js.MessageBuffer.tryReadHeaders (C:\Users\yashi.autorest@[email protected]\node_modules@autorest\core\dist\vendors-common_temp_node_modules_pnpm_azure-tools_extension_3_1_272_node_modules_azure-tools_-78c196.js:85719:17) at StreamMessageReader.exports.modules.../../../common/temp/node_modules/.pnpm/[email protected]/node_modules/vscode-jsonrpc/lib/messageReader.js.StreamMessageReader.onData (C:\Users\yashi.autorest@[email protected]\node_modules@autorest\core\dist\vendors-common_temp_node_modules_pnpm_azure-tools_extension_3_1_272_node_modules_azure-tools_-78c196.js:85848:43) at Socket. (C:\Users\yashi.autorest@[email protected]\node_modules@autorest\core\dist\vendors-common_temp_node_modules_pnpm_azure-tools_extension_3_1_272_node_modules_azure-tools_-78c196.js:85839:19) at Socket.emit (events.js:326:22) at addChunk (_stream_readable.js:297:12) at readableAddChunk (_stream_readable.js:272:9) at Socket.Readable.push (_stream_readable.js:213:10) at Pipe.onStreamRead (internal/stream_base_commons.js:188:23)

bangbingsyb avatar Feb 11 '21 23:02 bangbingsyb

Hi @bangbingsyb could you confirm the version of dotnet you have installed. I think the actual issue here is

Unknown option: --roll-forward

which is a flag used on the dotnet start command for the chsarp generator v3

timotheeguerin avatar Feb 11 '21 23:02 timotheeguerin

Hi @bangbingsyb could you confirm the version of dotnet you have installed. I think the actual issue here is

Unknown option: --roll-forward

which is a flag used on the dotnet start command for the chsarp generator v3

Awesome! Thanks for pointing out the root cause, @timotheeguerin . It was indeed a .NET core SDK version conflict. I resolved it by uninstalling the lower versions SDK. Thanks for your help!

bangbingsyb avatar Feb 17 '21 20:02 bangbingsyb

hi @bangbingsyb, what are the versions used here, can you share?

yashwanthkotla avatar Oct 20 '23 11:10 yashwanthkotla