{"record":{"id":"10b6e5004d111bd0","repo":"owasp-amass/amass","slug":"failed-to-create-the-session-manager","errorCode":null,"errorMessage":"failed to create the session manager","messagePattern":"failed to create the session manager","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"engine/engine.go","lineNumber":44,"sourceCode":"\tDispatcher et.Dispatcher\n\tRegistry   et.Registry\n\tManager    et.SessionManager\n\tServer     *server.Server\n}\n\nfunc NewEngine(l *slog.Logger) (*Engine, error) {\n\tgo func() {\n\t\t_ = http.ListenAndServe(\"127.0.0.1:6060\", nil)\n\t}()\n\n\tif l == nil {\n\t\tl = slog.New(slog.NewTextHandler(os.Stdout, nil))\n\t}\n\n\treg := registry.NewRegistry(l)\n\tmgr := sessions.NewManager(l, reg)\n\tif mgr == nil {\n\t\treturn nil, errors.New(\"failed to create the session manager\")\n\t}\n\n\tdis := dispatcher.NewDispatcher(l, reg, mgr)\n\tif err := plugins.LoadAndStartPlugins(reg); err != nil {\n\t\treturn nil, err\n\t}\n\n\tsrv, err := server.NewServer(l, dis, mgr)\n\tif err != nil || srv == nil {\n\t\tdis.Shutdown()\n\t\tmgr.Shutdown()\n\t\treturn nil, errors.New(\"failed to create the API server\")\n\t}\n\n\tch := make(chan error, 1)\n\tgo func(errch chan error) { errch <- srv.Start() }(ch)\n\n\tt := time.NewTimer(3 * time.Second)","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/engine/engine.go#L26-L62","documentation":"NewEngine constructs the core engine; sessions.NewManager returning nil means the session manager could not be instantiated, so the engine cannot manage enumeration sessions and NewEngine aborts with this error.","triggerScenarios":"Calling NewEngine (via CLIWorkflow) when sessions.NewManager returns nil — an internal construction failure of the session manager (e.g. nil registry/logger downstream).","commonSituations":"Inconsistent or broken build where the sessions package fails its internal checks; corrupted installation; a code change altering NewManager's contract without updating this check.","solutions":["Rebuild/reinstall the engine to ensure the sessions package is intact","Check that registry.NewRegistry returned a valid registry before creating the manager","Inspect sessions.NewManager for conditions that return nil and fix the underlying cause","Report upstream if NewManager nil-returns with valid inputs"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"eng, err := NewEngine(cfg)\nif err != nil {\n    log.Fatalf(\"engine initialization failed: %v\", err)\n}","preventionTips":["Keep engine and sessions packages built from the same version","Verify registry construction succeeds before creating the manager","Run a smoke test of NewEngine in CI to catch nil-manager regressions"],"tags":["engine","sessions","initialization"],"backgroundTag":"module-init-failed","analyzedSha":"79299dce87b0085db0f2f4ef3e9c52cccb49f514","analyzedAt":"2026-09-06T08:22:48.198Z","contentChangedAt":"2026-09-06T08:22:48.198Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}