Azure / azure-functions-core-tools

Command line tools for Azure Functions
MIT License
1.32k stars 433 forks source link

Possible regression: https://github.com/Azure/azure-functions-core-tools/issues/1457 (Error calling sync triggers (BadRequest)) #1836

Closed drmiru closed 4 years ago

drmiru commented 4 years ago

Hi

I'm getting this error since yesterday when trying to publish functions to a consumption plan in westeurope.

func azure functionapp publish p-fap-miru-01 Getting site publishing info... Creating archive for current directory... Uploading 4.98 KB [###############################################################################] Upload completed successfully. Deployment completed successfully. Syncing triggers... Syncing triggers... Syncing triggers... Syncing triggers... Syncing triggers... Syncing triggers... Error calling sync triggers (BadRequest). Request ID = '0096f660-403d-4143-aaf0-9c5442c779f0'.

balag0 commented 4 years ago

Can you check if the value for appsetting "AzureWebJobsStorage" looks good.

App is failing with the following exception

System.FormatException : Settings must be of the form "name=value". at Microsoft.WindowsAzure.Storage.CloudStorageAccount.<>c.b__97_0(String err) at Microsoft.WindowsAzure.Storage.CloudStorageAccount.ParseStringIntoSettings(String connectionString,Action1 error) at Microsoft.WindowsAzure.Storage.CloudStorageAccount.ParseImpl(String connectionString,CloudStorageAccount& accountInformation,Action1 error) at Microsoft.WindowsAzure.Storage.CloudStorageAccount.Parse(String connectionString) at Microsoft.Azure.WebJobs.Script.WebHost.BlobStorageSecretsRepository.CreateBlobContainer(String connectionString) at C:\azure-webjobs-sdk-script\src\WebJobs.Script.WebHost\Security\KeyManagement\BlobStorageSecretsRepository.cs : 68 at Microsoft.Azure.WebJobs.Script.WebHost.BlobStorageSecretsRepository..ctor(String secretSentinelDirectoryPath,String accountConnectionString,String siteSlotName,ILogger logger) at C:\azure-webjobs-sdk-script\src\WebJobs.Script.WebHost\Security\KeyManagement\BlobStorageSecretsRepository.cs : 55 at Microsoft.Azure.WebJobs.Script.WebHost.DefaultSecretManagerProvider.CreateSecretsRepository() at C:\azure-webjobs-sdk-script\src\WebJobs.Script.WebHost\Security\KeyManagement\DefaultSecretManagerProvider.cs : 82 at Microsoft.Azure.WebJobs.Script.WebHost.DefaultSecretManagerProvider.Create() at C:\azure-webjobs-sdk-script\src\WebJobs.Script.WebHost\Security\KeyManagement\DefaultSecretManagerProvider.cs : 53 at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode) at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Lazy1.CreateValue() at System.Lazy`1.get_Value() at Microsoft.Azure.WebJobs.Script.WebHost.DefaultSecretManagerProvider.get_Current() at C:\azure-webjobs-sdk-script\src\WebJobs.Script.WebHost\Security\KeyManagement\DefaultSecretManagerProvider.cs : 49 at async Microsoft.Azure.WebJobs.Script.WebHost.Management.FunctionsSyncManager.GetSyncTriggersPayload() at C:\azure-webjobs-sdk-script\src\WebJobs.Script.WebHost\Management\FunctionsSyncManager.cs : 308 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at async Microsoft.Azure.WebJobs.Script.WebHost.Management.FunctionsSyncManager.TrySyncTriggersAsync(Boolean isBackgroundSync) at C:\azure-webjobs-sdk-script\src\WebJobs.Script.WebHost\Management\FunctionsSyncManager.cs : 110

ghost commented 4 years ago

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

kjoshi commented 4 years ago

I'm having the same problem when trying to publish a FunctionApp in West Europe:

 > func azure functionapp publish jiscvisdatawebapp --build remote                                                                    
Getting site publishing info...
Creating archive for current directory...
Performing remote build for functions project.
Deleting the old .python_packages directory
...
Deployment successful.
Remote build succeeded!
Syncing triggers...
Syncing triggers...
Syncing triggers...
Syncing triggers...
Syncing triggers...
Syncing triggers...
Error calling sync triggers (BadRequest). Request ID = 'd507387c-2978-4158-bda1-3eb59abcb2f0'.

Is there anything I can try on my end to try and resolve this?

mitsuo0114 commented 4 years ago

Same here. I'm trying to upload from Japan to EastUS.

$ func azure functionapp publish logforward --python
Getting site publishing info...
Directory .python_packages already in sync with requirements.txt. Skipping restoring dependencies...
Uploading package...
Uploading 11.03 MB [##############################################################################]
Upload completed successfully.
Deployment completed successfully.
Syncing triggers...
Syncing triggers...
Syncing triggers...
Syncing triggers...
Syncing triggers...
Syncing triggers...
Error calling sync triggers (BadRequest).
$ func --version
2.7.1505
drmiru commented 4 years ago

I think I found a possible root cause. If I either publish without local appsettings or leave just the "AzureWebJobsStorage" app settings behind, it works as expected. Any idea why?

balag0 commented 4 years ago

@drmiru I shared the root cause earlier - https://github.com/Azure/azure-functions-core-tools/issues/1836#issuecomment-588634204. Your app had an invalid connection string in AzureWebJobsStorage. Fixing that connection string should get your app working again. Feel free to reopen this issue if the app still doesn't work.

@kjoshi Looks like the request is failing due to the below exception. Please check if the appsetting AzureWebJobsStorage is valid and in the right format. If that doesnt help please open a different issue and ping me on it.

System.FormatException : Settings must be of the form 'name=value'. at Microsoft.WindowsAzure.Storage.CloudStorageAccount.<>c.b__97_0(String err) at Microsoft.WindowsAzure.Storage.CloudStorageAccount.ParseStringIntoSettings(String connectionString,Action1 error) at Microsoft.WindowsAzure.Storage.CloudStorageAccount.ParseImpl(String connectionString,CloudStorageAccount& accountInformation,Action1 error) at Microsoft.WindowsAzure.Storage.CloudStorageAccount.Parse(String connectionString) at Microsoft.Azure.WebJobs.Script.WebHost.BlobStorageSecretsRepository.CreateBlobContainer(String connectionString) at /src/azure-functions-host/src/WebJobs.Script.WebHost/Security/KeyManagement/BlobStorageSecretsRepository.cs : 68 at Microsoft.Azure.WebJobs.Script.WebHost.BlobStorageSecretsRepository..ctor(String secretSentinelDirectoryPath,String accountConnectionString,String siteSlotName,ILogger logger) at /src/azure-functions-host/src/WebJobs.Script.WebHost/Security/KeyManagement/BlobStorageSecretsRepository.cs : 55 at Microsoft.Azure.WebJobs.Script.WebHost.DefaultSecretManagerProvider.CreateSecretsRepository() at /src/azure-functions-host/src/WebJobs.Script.WebHost/Security/KeyManagement/DefaultSecretManagerProvider.cs : 82 at Microsoft.Azure.WebJobs.Script.WebHost.DefaultSecretManagerProvider.Create() at /src/azure-functions-host/src/WebJobs.Script.WebHost/Security/KeyManagement/DefaultSecretManagerProvider.cs : 53 at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode) at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Lazy1.CreateValue() at Microsoft.Azure.WebJobs.Script.WebHost.DefaultSecretManagerProvider.get_Current() at /src/azure-functions-host/src/WebJobs.Script.WebHost/Security/KeyManagement/DefaultSecretManagerProvider.cs : 49 at async Microsoft.Azure.WebJobs.Script.WebHost.Management.FunctionsSyncManager.GetSyncTriggersPayload() at /src/azure-functions-host/src/WebJobs.Script.WebHost/Management/FunctionsSyncManager.cs : 294 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at async Microsoft.Azure.WebJobs.Script.WebHost.Management.FunctionsSyncManager.TrySyncTriggersAsync(Boolean checkHash) at /src/azure-functions-host/src/WebJobs.Script.WebHost/Management/FunctionsSyncManager.cs : 110

@mitsuo0114 Looks like the app is deleted. If you are still seeing issues with the app please open a new issue and ping me on it.