【Azure Durable Function】PowerShell Activity 函数遇见 Newtonsoft.Json.JsonReaderException: The reader's MaxDepth of 64 has been exceeded.

简介: 【Azure Durable Function】PowerShell Activity 函数遇见 Newtonsoft.Json.JsonReaderException: The reader's MaxDepth of 64 has been exceeded.

问题描述

创建PowerShell Azure Durable Function,执行大量的PowerShell脚本操作Azure Resource,遇见了一个非常非常奇怪的问题:

Function 'Hello1 (Activity)' failed with an error. Reason: Newtonsoft.Json.JsonReaderException: The reader's MaxDepth of 64 has been exceeded. Path '[9].Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.StorageAccount.BlobStorageUri', line 1, position 103037.

at Newtonsoft.Json.JsonReader.Push(JsonContainerType value)

at Newtonsoft.Json.JsonTextReader.ParseValue()

at Newtonsoft.Json.JsonWriter.WriteToken(JsonReader reader, Boolean writeChildren, Boolean writeDateConstructorAsDate, Boolean writeComments)

at Newtonsoft.Json.Linq.JTokenWriter.WriteToken(JsonReader reader, Boolean writeChildren, Boolean writeDateConstructorAsDate, Boolean writeComments)

Stack: .

 

问题解答

Function 'Hello1 (Activity)' failed with an error. Reason: Newtonsoft.Json.JsonReaderException: The reader's MaxDepth of 64 has been exceeded. 
Path '[9].Context.
Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.
Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.
Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.
Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.
Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.
Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.
StorageAccount.BlobStorageUri', line 1, position 103037.
at Newtonsoft.Json.JsonReader.Push(JsonContainerType value)

 

因为异常中的Stack并没有指明是那一句代码引起的异常,所以只好使用最笨的办法。

一行代码一行代码的调试。


image.png image.png image.png image.png

image.png

image.png

image.png

目录
打赏
0
2
3
0
203
分享
相关文章
【Azure Fabric Service】演示使用PowerShell命令部署SF应用程序(.NET)
本文详细介绍了在中国区微软云Azure上使用Service Fabrics服务时,通过PowerShell命令发布.NET应用的全过程。由于Visual Studio 2022无法直接发布应用,需借助PowerShell脚本完成部署。文章分三步讲解:首先在Visual Studio 2022中打包应用部署包,其次连接SF集群并上传部署包,最后注册应用类型、创建实例并启动服务。过程中涉及关键参数如服务器证书指纹和服务端证书指纹的获取,并附带图文说明,便于操作。参考官方文档,帮助用户成功部署并运行服务。
129 72
083_类_对象_成员方法_method_函数_function_isinstance
本内容主要讲解Python中的数据类型与面向对象基础。回顾了变量类型(如字符串`str`和整型`int`)及其相互转换,探讨了加法在不同类型中的表现。通过超市商品分类比喻,引出“类型”概念,并深入解析类(class)与对象(object)的关系,例如具体橘子是橘子类的实例。还介绍了`isinstance`函数判断类型、`type`与`help`探索类型属性,以及`str`和`int`的不同方法。最终总结类是抽象类型,对象是其实例,不同类型的对象有独特运算和方法,为后续学习埋下伏笔。
50 7
083_类_对象_成员方法_method_函数_function_isinstance
|
17天前
|
[oeasy]python086方法_method_函数_function_区别
本文详细解析了Python中方法(method)与函数(function)的区别。通过回顾列表操作如`append`,以及随机模块的使用,介绍了方法作为类的成员需要通过实例调用的特点。对比内建函数如`print`和`input`,它们无需对象即可直接调用。总结指出方法需基于对象调用且包含`self`参数,而函数独立存在无需`self`。最后提供了学习资源链接,方便进一步探索。
53 17
[oeasy]python083_类_对象_成员方法_method_函数_function_isinstance
本文介绍了Python中类、对象、成员方法及函数的概念。通过超市商品分类的例子,形象地解释了“类型”的概念,如整型(int)和字符串(str)是两种不同的数据类型。整型对象支持数字求和,字符串对象支持拼接。使用`isinstance`函数可以判断对象是否属于特定类型,例如判断变量是否为整型。此外,还探讨了面向对象编程(OOP)与面向过程编程的区别,并简要介绍了`type`和`help`函数的用法。最后总结指出,不同类型的对象有不同的运算和方法,如字符串有`find`和`index`方法,而整型没有。更多内容可参考文末提供的蓝桥、GitHub和Gitee链接。
42 11
|
5月前
【Azure App Service】PowerShell脚本批量添加IP地址到Web App允许访问IP列表中
Web App取消公网访问后,只允许特定IP能访问Web App。需要写一下段PowerShell脚本,批量添加IP到Web App的允许访问IP列表里!
箭头函数与普通函数(function)的区别
箭头函数是ES6引入的新特性,与传统函数相比,它有更简洁的语法,且没有自己的this、arguments、super或new.target绑定,而是继承自外层作用域。箭头函数不适用于构造函数,不能使用new关键字调用。
【Azure Function】FTP上传了Python Function文件后,无法在门户页面加载函数的问题
通过FTP上传Python Function至Azure云后,出现函数列表无法加载的问题。经排查,发现是由于`requirements.txt`中的依赖包未被正确安装。解决方法为:在本地安装依赖包到`.python_packages/lib/site-packages`目录,再将该目录内容上传至云上的`wwwroot`目录,并重启应用。最终成功加载函数列表。
箭头函数与普通函数(function)的区别
箭头函数是ES6引入的新语法,相比传统函数表达式更简洁,且没有自己的this、arguments、super或new.target绑定,而是继承自外层作用域。这使得箭头函数在处理回调和闭包时更加灵活方便。
|
6月前
|
函数对象包装器function和bind机制
函数对象包装器function和bind机制
47 0
【Azure Entra ID】使用PowerShell脚本导出Entra ID中指定应用下的所有用户信息
在Azure Entra ID中,需要导出一个Application 下的用户信息, 包含User的创建时间。

热门文章

最新文章