gotranseo/template

Error 500

Closed this issue · 11 comments

Hi Team

I'm download and build your template, but I can run the app. On the console I see:

[ INFO ] Migrating 'mysql' database (/Users/.../Desktop/TranseoTestTemplate/.build/checkouts/fluent/Sources/Fluent/Migration/MigrationConfig.swift:69)
⚠️ [Abort.500: Internal Server Error] [/Users/.../Desktop/TranseoTestTemplate/Sources/App/Setup/databases.swift:14:88]
Program ended with exit code: 1

can you help me to fix this?
thanks

jdmcd commented

Hi there! Take a look at line 14 in databases.swift - looks like there is an environment variable you're not setting :)

sorry about that... I saw the Constants struct, and just to confirm, do I need set the 3 properties on databases.swift? are there a fast way to test your template on a localhost env? 🤔

Thanks for your fast answer

jdmcd commented

No prob :) Yes, all three need to be set. Once you have a local database setup you'll be able to run everything locally 👍

hmmm... sorry @mcdappdev ... I'm too new using vapor. I'm installed redis from hombrew, but... that's it... I keep not understand what data need the app to run 😢

Thanks for your help

jdmcd commented

No problem! You're also going to need a MySQL server locally.

Hi @mcdappdev

So, I'm installed MySql 5.7 and Redis.
So, i'm changed the constants like this:

 static let databaseURL = "127.0.0.1"
    static let redisURL = "127.0.0.1:6379"

but, im still having this error on the console:

[Abort.500: Internal Server Error] [/Users/marceloperretta/Desktop/TranseoTestTemplate/Sources/App/Setup/databases.swift:14:88]

any advice ? thanks

PD: sorry for keep bother you :)

jdmcd commented

You shouldn't change the values inside of Constants.swift. You have to set those as environment variables which you can do via the Xcode scheme editor or through the command line via export.

yeah... thanks for that, I'm an step forward.

So, after to set the env variables and run the project I get:

[MySQLError.password: Password required for auth plugin.] ... Sources/MySQL/Connection/MySQLConnectionHandler.swift:132:33]...

Should I need run this project using Docker or can I run the project locally?

jdmcd commented

You can definitely run it locally. Looks like maybe you're not specifying a password in the env variable? It should look something like this:

mysql://username:password@localhost:3306/database

awesome... that works, the projects its running now. So, the only missing are the leaf, but that its not a problem.

you're the best :)

jdmcd commented

Awesome! Glad I could help :)