{"record":{"id":"08bd1268ee5b62b9","repo":"amark/gun","slug":"user-cannot-be-found","errorCode":null,"errorMessage":"User cannot be found!","messagePattern":"User cannot be found!","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sea/auth.js","lineNumber":135,"sourceCode":"        act.w(JSON.stringify({ek: auth, s: act.salt}));\n      }\n      act.w = function(auth){\n        if(opt.shuffle){ // delete in future!\n          console.log('migrate core account from UTF8 & shuffle');\n          var tmp = {}; Object.keys(act.data).forEach(function(k){ tmp[k] = act.data[k] });\n          delete tmp._;\n          tmp.auth = auth;\n          root.get('~'+act.pair.pub).put(tmp);\n        } // end delete\n        root.get('~'+act.pair.pub).get('auth').put(auth, cb || noop);\n      }\n      act.err = function(e){\n        var ack = {err: Gun.log(e || 'User cannot be found!')};\n        cat.ing = false;\n        (cb || noop)(ack);\n      }\n      act.plugin = function(name){\n        if(!(act.name = name)){ return act.err() }\n        var tmp = [name];\n        if('~' !== name[0]){\n          tmp[1] = '~'+name;\n          tmp[2] = '~@'+name;\n        }\n        act.b(tmp);\n      }\n      if(pair){\n        if(pair.priv && pair.epriv)\n          act.g(pair);\n        else\n          root.get('~'+pair.pub).once(act.h);\n      } else\n      if(alias){\n        root.get('~@'+alias).once(act.a);\n      } else\n      if(!alias && !pass){\n        SEA.name(act.plugin);","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/amark/gun/blob/552227599d47ba0493824b7fcf8a00c8cd6404ba/sea/auth.js#L117-L153","documentation":"This is the default error text in user.auth's act.err handler: when auth fails without a specific message (e === undefined), Gun logs 'User cannot be found!' and invokes the callback with { err }. It typically appears when the plugin/user lookup produced no name — e.g. act.plugin is called without a truthy name — or another internal auth failure path calls act.err() with no argument.","triggerScenarios":"Calling user.auth with arguments so malformed that no alias/name could be derived (e.g. auth() with no alias, or a plugin path passing an empty/falsy name so act.plugin hits return act.err()); any auth failure where the specific error is undefined falls back to this message via Gun.log(e || 'User cannot be found!').","commonSituations":"Passing undefined alias/password variables (missing form fields, unawaited promise values); calling auth before user.create finished; custom plugin/integration code calling the internal act pipeline with a falsy name.","solutions":["Ensure both alias and password are non-empty strings at the call site","Always supply the auth callback and read ack.err to see the real failure","Complete user.create before attempting auth, and check its ack","If using plugin-based auth, pass a truthy user/public key name"],"exampleFix":"// before — alias may be undefined\ngun.user().auth(alias, pass);\n// after\nif (typeof alias !== 'string' || !alias || typeof pass !== 'string' || !pass) {\n  throw new Error('alias and password are required');\n}\ngun.user().auth(alias, pass, ack => {\n  if (ack.err) return console.error(ack.err);\n});","handlingStrategy":"validation","validationCode":"if (typeof alias !== 'string' || !alias.trim()) {\n  throw new Error('alias required for auth');\n}\nif (typeof pass !== 'string' || !pass) {\n  throw new Error('password required for auth');\n}","typeGuard":"const isCred = (s) => typeof s === 'string' && s.length > 0;","tryCatchPattern":"gun.user().auth(alias, pass, ack => {\n  if (ack && ack.err) {\n    console.error('auth error:', ack.err); // includes 'User cannot be found!' fallback\n    return;\n  }\n});","preventionTips":["Validate alias/password are non-empty strings before auth","Await all async value resolution (form state, storage) before calling auth","Always supply the callback and log ack.err to see the real cause","Complete user.create successfully before authenticating"],"tags":["sea","auth","gun","user-not-found"],"backgroundTag":"gun-user-not-found","analyzedSha":"552227599d47ba0493824b7fcf8a00c8cd6404ba","analyzedAt":"2026-09-02T18:40:58.370Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T21:17:11.164Z"}