ironpython2: IronPython stops to work with module (json) after a while

Python 2.7.11 on .NET Core 3.1 hosted in Azure on service fabric. Initially everything works, after a while a certain library fails, namely json

{
    "ClassName": "System.MissingMemberException",
    "Message": "'module' object has no attribute 'dumps'",
    "Data": null,
    "InnerException": null,
    "HelpURL": null,
    "StackTraceString": "   at IronPython.Runtime.Operations.PythonOps.ObjectGetAttribute(CodeContext context, Object o, String name)\r\n   at IronPython.Runtime.PythonModule.__getattribute__(CodeContext context, String name)\r\n   at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)\r\n   at Microsoft.Scripting.Interpreter.FuncCallInstruction`5.Run(InterpretedFrame frame)\r\n   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)\r\n   at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)\r\n   at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)\r\n   at Ic.RestMocker.Core.Scripting.ScriptSession.Execute(String script, Dictionary`2 scope) in I:\\agent\\_work\\817\\s\\Ic.RestMocker.Core\\Scripting\\ScriptSession.cs:line 93\r\n   at Ic.RestMocker.Core.Controllers.ScriptsController.Post() in I:\\agent\\_work\\817\\s\\Ic.RestMocker.Core\\Controllers\\ScriptsController.cs:line 38",
    "RemoteStackTraceString": null,
    "RemoteStackIndex": 0,
    "ExceptionMethod": null,
    "HResult": -2146233070,
    "Source": "IronPython",
    "WatsonBuckets": null,
    "MMClassName": null,
    "MMMemberName": null,
    "MMSignature": null
}

If I create a script like

import sys
sys.path

Output is

[
    "D:\\SvcFab\\_App\\RestMocker.ApplicationType_App66\\RestMocker.ApiPkg.Code.1.0.0.RestMocker_master_20201123.2\\pylib"
]

Which is the correct path to pylib

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Comments: 16 (4 by maintainers)

Most upvoted comments

This is output from your commands btw, will test again when it breaks

11/23/2020, 7:25:34 PM

TRACE
['JSONDecoder', 'JSONEncoder', '__all__', '__author__', '__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__', '__version__', '_default_decoder', '_default_encoder', 'decoder', 'dump', 'dumps', 'encoder', 'load', 'loads', 'scanner']
Severity level: Information
11/23/2020, 7:25:34 PM

TRACE
<module 'json' from 'D:\SvcFab\_App\RestMocker.ApplicationType_App66\RestMocker.ApiPkg.Code.1.0.0.RestMocker_master_20201123.4\pylib\json\__init__.py'>
Severity level: Information