question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

func init failure

See original GitHub issue

func init fails. It took some fiddling to get --cli-dev to work, since it doesn’t recognize an implicit working directory. Git wasn’t in my path, and I thought that might be the issue but it fails even when git is present in the path.

c:\GitHub\AzureFunctions>func init
Writing .gitignore
Writing host.json
Writing .secrets
Error: The system cannot find the file specified
You can run the same command passing --cli-dev and report an issue on https://github.com/azure/azure-webjobs-sdk-script/issues

c:\GitHub\AzureFunctions>func init --cli-dev
Unable to parse option Folder

Azure Functions CLI 0.1
Usage: func init [Options]

   <folder>    (Required)
   --vsc       Version Control Software. Git or Hg
   --help      Show this help



c:\GitHub\AzureFunctions>func init . --cli-dev
Writing .gitignore
Writing host.json
Writing .secrets
System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
   at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
   at WebJobs.Script.Cli.Common.Executable.<RunAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at WebJobs.Script.Cli.Verbs.InitVerb.<RunAsync>d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at NCli.ConsoleApp.<RunAsync>d__5`1.MoveNext()

Repro steps

Provide the steps required to reproduce the problem

  1. npm i -g azurefunctions

  2. npm i -g generator-azurefunctions yo

  3. func init

Expected behavior

func init should succeed.

Actual behavior

Apparently an exe can’t be found but I don’t know which one.

Known workarounds

Unknown

Related information

npm 3.10.8 node 6.9.1 git 2.6.2.windows.1

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:14 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
s1monfarrowcommented, Nov 24, 2016

This was what I did:

npm i -g azure-functions-cli mkdir functest cd functest func init

Writing .gitignore Writing host.json Writing appsettings.json System.ComponentModel.Win32Exception (0x80004005): The system cannot find the fi le specified at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startIn fo) at System.Diagnostics.Process.Start() at System.Diagnostics.Process.Start(ProcessStartInfo startInfo) at WebJobs.Script.Cli.Common.Executable.<RunAsync>d__6.MoveNext() — End of stack trace from previous location where exception was thrown — at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNot ification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at WebJobs.Script.Cli.Actions.LocalActions.InitAction.<RunAsync>d__5.MoveNext () --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNot ification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult() at WebJobs.Script.Cli.ConsoleApp.<RunAsync>d__41.MoveNext()

On 23 Nov 2016, at 19:13, Donna Malayeri notifications@github.com wrote:

@s1monfarrow https://github.com/s1monfarrow Can you post the exact process you followed and the exception?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Azure/azure-webjobs-sdk-script/issues/887#issuecomment-262605951, or mute the thread https://github.com/notifications/unsubscribe-auth/AAxbFWYq77lBMjuFt1UHPsq0GM4dOz51ks5rBJBjgaJpZM4KsDLu.

0reactions
lindydonnacommented, Dec 20, 2016
Read more comments on GitHub >

github_iconTop Results From Across the Web

func init is not recognized on the local machine
the command. func init --worker-runtime dotnet --force. is failing with the message. 'func' is misspelled or not recognized by the system.
Read more >
Why am I getting an error in the GO init() method?
In Go foo:="bar" is a short assignment statement that can be used in a function in place of a var declaration.
Read more >
Handle errors in init
I have an init func in a package. Inside the init function, I have a database initialization which returns error. How can I...
Read more >
Enforce compiler error if init function isn't called? : r/rust
I would simply imagine an object that can only be obtained through that init function - even if that specific object doesn't contain...
Read more >
Golang Mistakes: #2 Misusing Init() Functions - Rezwanul's Blog
In this above Go blog example, the init function cannot fail ( http.HandleFunc can throw panic only if the handler is nil ,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found