New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sample TimerSamples.StartupJob is not working #529

Open
alincosmin7 opened this Issue Oct 29, 2018 · 5 comments

Comments

Projects
None yet
5 participants
@alincosmin7
Copy link

alincosmin7 commented Oct 29, 2018

I disabled all other triggers and keep only TimerSamples class.
When start the sample I get these errors in logs, but only for StartupJob

dbug: Microsoft.Extensions.Hosting.Internal.Host[1]
Hosting starting
info: Microsoft.Azure.WebJobs.Hosting.JobHostService[0]
Starting JobHost
info: Host.Startup[0]
Found the following functions:
WebJobsSandbox.TimerSamples.CronJob
WebJobsSandbox.TimerSamples.StartupJob
WebJobsSandbox.TimerSamples.TimerJob
WebJobsSandbox.TimerSamples.WeeklyTimerJob

dbug: Host.Singleton[0]
Singleton lock acquired (cead61-62cf-47f4-93b4-6efcded6/WebJobsSandbox.TimerSamples.CronJob.Listener)
info: Host.Triggers.Timer[0]
The next 5 occurrences of the schedule will be:
10/29/2018 11:38:15 PM
10/29/2018 11:38:30 PM
10/29/2018 11:38:45 PM
10/29/2018 11:39:00 PM
10/29/2018 11:39:15 PM

dbug: Host.Singleton[0]
Singleton lock acquired (cead61-62cf-47f4-93b4-6efcded6/WebJobsSandbox.TimerSamples.StartupJob.Listener)
fail: Host.Startup[0]
The listener for function 'TimerSamples.StartupJob' was unable to start.
Microsoft.Azure.WebJobs.Host.Listeners.FunctionListenerException: The listener for function 'TimerSamples.StartupJob' was unable to start. ---> System.ArgumentNullException: Value cannot be null.
Parameter name: connectionString
at Microsoft.WindowsAzure.Storage.CloudStorageAccount.Parse(String connectionString) in C:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\Common\CloudStorageAccount.cs:line 524
at Microsoft.Azure.WebJobs.Extensions.Timers.StorageScheduleMonitor.get_TimerStatusDirectory() in C:\Users\MyUser\Downloads\azure-webjobs-sdk-extensions-master\src\WebJobs.Extensions\Extensions\Timers\Scheduling\StorageScheduleMonitor.cs:line 78

@mathewc

This comment has been minimized.

Copy link
Contributor

mathewc commented Oct 31, 2018

The error is happening because you don't have a storage account configured. The error message should be improved. TimerTrigger by default leverages storage for singleton locks. Can you provide a storage account connection string for AzureWebJobsStorage via app settings and try again?

@vainolo

This comment has been minimized.

Copy link
Member

vainolo commented Nov 17, 2018

Bumped into this in my local dev environment today while playing with timer triggers. What seems strange to me is that you can add a dummy value in the AzureWebJobsStorage and things work just fine even when I have two functions that trigger at the same. When will this fail? And if the storage is required, why isn't it validated the first time I execute the timer function?

@SeboStone

This comment has been minimized.

Copy link

SeboStone commented Jan 23, 2019

I have the same issue in my own implementation and I want to configure the Azure Storage Connection, but how? I did not found any documentation to do that with the new version 3.0 and the AddAzureStorage() method have not a parameter to add a connectionstring. Can you help me?

@mathewc

This comment has been minimized.

Copy link
Contributor

mathewc commented Jan 24, 2019

In v3 there isn't a top level config property for the storage account connection string (i.e. no imperative JobHostConfiguration.StorageConnectionString equivalent). You need to provide the connection via .NET Core configuration (appsettings.json) or via an environment variable.

Agree that we need to improve the error handling here.

@tuanfred

This comment has been minimized.

Copy link

tuanfred commented Feb 7, 2019

What's happen if i do not use appsetting.json (because i use yaml format) ? API should not force to use appseting.json, pls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment