Giter Club home page Giter Club logo

Comments (8)

KD0BPV avatar KD0BPV commented on August 28, 2024

The following error is being returned by diesel at src/aardwolf/controllers/auth.rs:37
DatabaseError(__Unknown, "relation \"aardwolf.accounts\" does not exist")

from aardwolf.

KD0BPV avatar KD0BPV commented on August 28, 2024

From what I understand so far, this has to do with how we set up the schema in the database, and search_path. Default search_path is:

aardwolf=# show search_path;
   search_path   
-----------------
 "$user", public
(1 row)

I worked around it by:

  • create a new user "aardwolf"
  • change ownership of database, tables, schema to aardwolf

@pwoolcoc, Is there a reason we create a schema rather than just let it go into the default public schema for the database? If we let it go into the public schema, then the user name wouldn't have to match the database name. Or perhaps there's a way to set the search path in the migration files? Not sure which would be better, if the latter is possible.

from aardwolf.

pwoolcoc avatar pwoolcoc commented on August 28, 2024

I've been unable to replicate this issue, unfortunately. The search_path shouldn't be an issue here, diesel knows about postgres schemas and generates queries with the fully qualified name, which means the search_path isn't needed to locate the table. Could you narrow down exactly what is about your environment that causes this? My search path is the same as yours, and I don't need to do either of the workarounds to get this to work.

from aardwolf.

KD0BPV avatar KD0BPV commented on August 28, 2024

The only thing I can think of off the top of my head is that I had used a different username than the database name. @BanjoFox had the problem too, and we applied the same work-around, and it worked. I'll let you know if I think of anything more that might help us solve this.

from aardwolf.

pwoolcoc avatar pwoolcoc commented on August 28, 2024

Thanks, my username is my local user and it's always just worked for me. The username shouldn't affect how postgres looks for the tables since diesel uses the fully-qualified name in the queries.

from aardwolf.

pwoolcoc avatar pwoolcoc commented on August 28, 2024

It might be helpful to enable logging for your postgres server (if it isn't already) and set it to all. I see lines like this when I create an account:

LOG:  execute <unnamed>: INSERT INTO "aardwolf"."accounts" ("username") VALUES ($1) RETURNING "aardwolf"."accounts"."id", "aardwolf"."accounts"."username", "aardwolf"."accounts"."domain", "aardwolf"."accounts"."display_name", "aardwolf"."accounts"."created_at", "aardwolf"."accounts"."updated_at"
DETAIL:  parameters: $1 = 'testing'
LOG:  execute <unnamed>: INSERT INTO "aardwolf"."users" ("encrypted_password", "account_id", "unconfirmed_email", "confirmation_token", "confirmation_sent_at") VALUES ($1, $2, $3, $4, $5) RETURNING "aardwolf"."users"."id", "aardwolf"."users"."email", "aardwolf"."users"."encrypted_password", "aardwolf"."users"."account_id", "aardwolf"."users"."admin", "aardwolf"."users"."disabled", "aardwolf"."users"."unconfirmed_email", "aardwolf"."users"."confirmation_token", "aardwolf"."users"."confirmed_at", "aardwolf"."users"."confirmation_sent_at", "aardwolf"."users"."created_at", "aardwolf"."users"."updated_at"
DETAIL:  parameters: $1 = '$2y$12$CFhS4vfRzDHamzagNUtf1ulR8ptZX4OsERHRMPx5Q5ugASxCxFTg2', $2 = '4da6cfb7-8540-4b13-94e9-eccc51c1e895', $3 = '[email protected]', $4 = '\xf74eec7acec3261f82053b7f46704213', $5 = '2018-01-02 19:21:35.327884'

When the query fails, it might be worth trying those same queries in psql to if diesel is doing something wrong.

from aardwolf.

BanjoFox avatar BanjoFox commented on August 28, 2024

It should be easy enough to replicate on the test-server. Blow away the DB, and start fresh :)

from aardwolf.

KD0BPV avatar KD0BPV commented on August 28, 2024

As long as nothing gets in the way, the new setup program seems to have fixed things. I just wiped out my aardwolf database, re-configured aardwolf to use my db account, and ran the setup. This time around, I was able to create, confirm, and log into an account without issue. Closing.

However, there is a problem with the new setup program. Please see Issue #63.

from aardwolf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.