0

I have an Azure time trigger function developed in Azure portal which will trigger once in a day. The triggering function was working fine yesterday, but suddenly today function is returning the below error while running the function.

2019-08-26T05:10:55.509 [Error] Function compilation error
2019-08-26T05:10:55.509 [Error] error CS0041: Unexpected error writing debug information -- 'The version of Windows PDB writer is older than required: 'diasymreader.dll''
2019-08-26T05:10:55.539 [Error] Exception while executing function: Functions.TimerTriggerCSharp1. Microsoft.Azure.WebJobs.Script: Script compilation failed.
2019-08-26T05:10:55.586 [Error] Function completed (Failure, Id=361874a9-10d7-4fc2-9a53-ec17f7a65a78, Duration=100ms)

Below is the project.json file which I have created.

{
  "frameworks": {
    "net46":{
      "dependencies": {
        "Microsoft.Azure.DocumentDB": "2.0.0"
      }
    }
   }
}

Below is the .csx file

#r "Microsoft.Azure.Documents.Client"

    using System;
    using Microsoft.Azure.Documents;
    using Microsoft.Azure.Documents.Client;
    using Microsoft.Azure.WebJobs.Host;
    using Newtonsoft.Json;

    public static async Task Run(TimerInfo myTimer,  IEnumerable<dynamic> 
    inputDocument, TraceWriter log)
    {
    log.Info($"C# Timer trigger function started at: {DateTime.Now}");

    // Get the date 6 months before from Current Time in IST and convert to Epoch value. 
    TimeZoneInfo INDIAN_ZONE = TimeZoneInfo.FindSystemTimeZoneById("India 
    Standard Time");
    DateTime indianTime =  
    TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow.AddDays(-180), 
    INDIAN_ZONE);


    long epochTime = (long)(indianTime - new DateTime(1970, 1, 
    1)).TotalSeconds;

    DocumentClient client;
    string endpoint = "https://***cosmosdb.documents.azure.com:443/";
    string key = "****";
    client = new DocumentClient(new Uri(endpoint), key);

    foreach (var doc in inputDocument)
        {
            string partKey = doc.NUM;
            StoredProcedureResponse<bool> sprocResponse = await 
    client.ExecuteStoredProcedureAsync<bool>(

   "/dbs/DB_NAME/colls/COLLECTION_NAME/sprocs/STORED PROC_NAME/",new 
    RequestOptions { PartitionKey = new PartitionKey(partKey) });

            log.Info($"Cosmos DB is updated at: {DateTime.Now}");
        }
    }

Since it was working fine last day, What might be the reason for a sudden failure with this error? How to get this solved ? Trigger Function is developed in Azure Portal.

2
  • Did you try restarting the function app as well as the app service plan ? Commented Aug 26, 2019 at 6:00
  • Yes I tried and It is working after restarting the function App. But the function is time trigger function and if it throws the same error will that affect the function execution?. Commented Aug 27, 2019 at 9:40

1 Answer 1

0

But the function is time trigger function and if it throws the same error will that affect the function execution?.

Yes, it will affect the function execution, no matter timer trigger or queue trigger. As the log said, Function completed (Failure, which means the function execute failed.

Sign up to request clarification or add additional context in comments.

1 Comment

So what might be the reason for this PDB writer error which cause failure of compilation and is there any workaround so that we can avoid this failure?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.