Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yesod silently ignoring config/settings.yml scaffold config #474

Closed
koeppl opened this issue Jan 4, 2013 · 6 comments
Closed

Yesod silently ignoring config/settings.yml scaffold config #474

koeppl opened this issue Jan 4, 2013 · 6 comments

Comments

@koeppl
Copy link

koeppl commented Jan 4, 2013

With the dawn of yesod-1.1.7.2 and yesod-core-1.1.7.1,
the config file in config/settings.yml is blindly ignored by yesod devel,
though removing the file yields a compile-expection

devel.hs: InvalidYaml (Just (YamlException "Yaml file not found: config/settings.yml"))

But if I'm changing port, approot or anything else, yesod will still insist to run the devel-application on http://localhost:3000

Starting development server...

on the commandline: Warning:
    -package-confdist/package.conf.inplace is deprecated: Use -package-db instead
    Starting devel application
    Devel application launched: http://localhost:3000

By the way, I'm still trying to upgrade my old scaffolding site to the newer version of yesod (as in yesodweb/persistent#111).
Now I get on the last steps of yesod devel merely the message
Starting devel application
Devel application launched: http://localhost:3000
devel.hs: user error (when expecting a String, encountered Null instead)
Exit code: ExitFailure 1
I do not know how to deal with this message as I've not modified devel.hs in any kind.

@snoyberg
Copy link
Member

snoyberg commented Jan 4, 2013

For the first point: you need to set port via command line parameters to yesod devel. Changing approot isn't supported (or necessary). The settings in config/settings.yml still apply if you run a compiled version of your app with the "development" parameter.

That second message is most likely coming from the parsing of either settings.yml or your database config file. Can you compare those against a scaffolded file and see what the differences are?

@koeppl
Copy link
Author

koeppl commented Jan 4, 2013

Thank's for the fast reply. So the first point is solved, but for the second I still have no clue...
If I'm creating a new scaffolding site with postgres (the same database as for my current site) and changing config/postgres.yml to address my postgres-server, I'm receiving the same error.

$ yesod devel
Yesod devel server. Press ENTER to quit
Configuring b-0.0.0...
Warning: This package indirectly depends on multiple versions of the same
package. This is highly likely to cause a compile failure.
package ghc-7.6.1 requires Cabal-1.16.0
package bin-package-db-0.0.0.0 requires Cabal-1.16.0
package yesod-1.1.7.2 requires Cabal-1.16.0.3
package bin-package-db-0.0.0.0 requires binary-0.5.1.1
package pureMD5-2.1.2.1 requires binary-0.6.4.0
package SHA-1.6.1 requires binary-0.6.4.0
Forcing recompile for ./Model.hs because of config/models
Forcing recompile for ./Foundation.hs because of config/routes
Forcing recompile for ./Foundation.hs because of messages/en.msg
Forcing recompile for ./Foundation.hs because of templates/default-layout-wrapper.hamlet
Forcing recompile for ./Foundation.hs because of templates/default-layout.hamlet
Forcing recompile for ./Handler/Home.hs because of templates/homepage.hamlet
Forcing recompile for ./Handler/Home.hs because of templates/homepage.julius
Forcing recompile for ./Handler/Home.hs because of templates/homepage.lucius
Forcing recompile for ./Foundation.hs because of templates/normalize.lucius
Rebuilding application... (using Cabal library)
Starting development server...

on the commandline: Warning:
    -package-confdist/package.conf.inplace is deprecated: Use -package-db instead
    Starting devel application
    Devel application launched: http://localhost:3000
    devel.hs: user error (when expecting a String, encountered Null instead)
    Exit code: ExitFailure 1

@snoyberg
Copy link
Member

snoyberg commented Jan 4, 2013

What's the actual change you're making?

@koeppl
Copy link
Author

koeppl commented Jan 4, 2013

The exception was indeed very accurate as I'm using a postgres account without password,
e.g. the password field was empty.
I don't know if it's intended to force using a password for the database as I was too lazy to do so...
(After all, the configuration was valid under the pervious yesod version)
So, after adding a password to my postgres-account, the problem is solved.

@snoyberg
Copy link
Member

snoyberg commented Jan 5, 2013

For future reference, I think you could use "" as the password value. At this point, is this issue resolved?

@koeppl
Copy link
Author

koeppl commented Jan 6, 2013

The workaround with the explicit quotations solves the issue for empty passwords.

@koeppl koeppl closed this as completed Jan 6, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants