stablekernel / aqueduct

Dart HTTP server framework for building REST APIs. Includes PostgreSQL ORM and OAuth2 provider.
https://aqueduct.io
BSD 2-Clause "Simplified" License
2.42k stars 280 forks source link

Relation "_authclient" does not exist #923

Closed rostopira closed 3 years ago

rostopira commented 3 years ago

I'm trying to create user using following code:

    var uid = generateUid();
    final password = generatePassword();
    final salt = generatePassword();
    final hashedSecret = authServer.hashPassword(password, salt);
    final newClient = AuthClient(uid, hashedSecret, salt);
    await authServer.addClient(newClient);

But it throws error:

[WARNING] aqueduct: PostgreSQLSeverity.error 42P01: relation "_authclient" does not exist   
[SEVERE] aqueduct: POST /auth/new 705ms 500 {user-agent : Dart/2.12 (dart:io)\naccept-encoding : gzip\ncontent-length : 0\nhost : 192.168.1.226:8888\ncontent-type : application/json\n}  PostgreSQLSeverity.error 42P01: relation "_authclient" does not exist
Reductions commented 3 years ago

First authclient is not a user it is a api client as per OAuth2 spec. What I suspect is that you have not generated and run migration for your project.

rostopira commented 3 years ago

Yeah, indeed, but when I following this guide another error is thrown

RangeError: Invalid value: Not in inclusive range 0..1114111: -1

It's caused by outdated postgres dependency, but I don't know how to override it in CLI

rostopira commented 3 years ago

I've tried to activate master branch and it's complaining about analyzer:

Error: Error when reading '../../.pub-cache/hosted/pub.dartlang.org/analyzer-0.41.1/lib/analyzer.dart': No such file or directory

Solved by following issue #913 And now getting "unable to connect to database"