azure-webjobs-sdk: QueueTrigger appears to be broke with Microsoft.NET.Sdk.Functions 1.0.19

below is my Azure Function that worked with 1.0.14


        [FunctionName("LaunchTenantListener")]
        public static async Task Run([QueueTrigger(Constants.Queue, Connection = Constants.StorageConnection)]string tenantID, [Inject] PollQueuesForTenant pollQueuesForTenant)
        {
            await pollQueuesForTenant.Execute(tenantID);
        }

I’m currently getting this error.

Newtonsoft.Json.JsonReaderException
  HResult=0x80131500
  Message=Input string '5c61b624-567e-433e-a28c-8b044430f087' is not a valid number. Path '', line 1, position 36.
  Source=Newtonsoft.Json
  StackTrace:
   at Newtonsoft.Json.JsonTextReader.ParseReadNumber(ReadType readType, Char firstChar, Int32 initialPosition)
   at Newtonsoft.Json.JsonTextReader.ParseNumber(ReadType readType)
   at Newtonsoft.Json.JsonTextReader.ParseValue()
   at Newtonsoft.Json.JsonTextReader.Read()
   at Newtonsoft.Json.Linq.JObject.Load(JsonReader reader, JsonLoadSettings settings)
   at Newtonsoft.Json.Linq.JObject.Load(JsonReader reader)
   at Microsoft.Azure.WebJobs.Host.Protocols.JsonSerialization.ParseJObject(String json) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Protocols\JsonSerialization.cs:line 102
   at Microsoft.Azure.WebJobs.Host.Queues.QueueCausalityManager.GetOwner(CloudQueueMessage msg) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Extensions.Storage\Queues\QueueCausalityManager.cs:line 55

Since our code wasn’t anywhere in the stack trace I changed the message that was being posted to the queue to a number and now I get

Newtonsoft.Json.JsonReaderException
  HResult=0x80131500
  Message=Error reading JObject from JsonReader. Current JsonReader item is not an object: Integer. Path '', line 1, position 3.
  Source=Newtonsoft.Json
  StackTrace:
   at Newtonsoft.Json.Linq.JObject.Load(JsonReader reader, JsonLoadSettings settings)
   at Newtonsoft.Json.Linq.JObject.Load(JsonReader reader)
   at Microsoft.Azure.WebJobs.Host.Protocols.JsonSerialization.ParseJObject(String json) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Protocols\JsonSerialization.cs:line 102
   at Microsoft.Azure.WebJobs.Host.Queues.QueueCausalityManager.GetOwner(CloudQueueMessage msg) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Extensions.Storage\Queues\QueueCausalityManager.cs:line 55

Also, can you please point me to the proper place for me to post that my local storage no longer appears in Cloud Explorer?

Thank you for an amazing product that in continuously getting more awesome.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 18 (7 by maintainers)

Most upvoted comments

Just ran into this issue too. Posting a json formatted string into the queue removes the exception and If I use a Type as the message, its also serialized correctly. Still sees it as a pain that the exception is thrown

The PR is now merged. For users to get this fix we’ll need to release an updated build of the Microsoft.Azure.WebJobs.Extensions.Storage NuGet package and then users will have to grab the update. The package should be published by mid October.