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

Cant start application #83

Open
insiderq opened this issue Oct 5, 2014 · 4 comments
Open

Cant start application #83

insiderq opened this issue Oct 5, 2014 · 4 comments

Comments

@insiderq
Copy link

insiderq commented Oct 5, 2014

Here is the problem, i followed you getting started readme and getting this in console

=ERROR REPORT==== 6-Oct-2014::01:15:07 ===
{incorrect_application_config,sqerl,
{prepared_statements,
{badmatch,undefined},
[{sqerl_rec,expand_if_app,1,[{file,"src/sqerl_rec.erl"},{line,326}]},
{sqerl_rec,'-statements/1-lc$^0/1-0-',1,
[{file,"src/sqerl_rec.erl"},{line,322}]},
{sqerl_rec,statements,1,[{file,"src/sqerl_rec.erl"},{line,322}]},
{sqerl_client,read_statements_from_config,0,
[{file,"src/sqerl_client.erl"},{line,254}]},
{sqerl_client,init,1,[{file,"src/sqerl_client.erl"},{line,126}]},
{gen_server,init_it,6,[{file,"gen_server.erl"},{line,306}]},
{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]}}

my config is

{sqerl, [
%% Database connection parameters
{db_host, "localhost" },
{db_port, 5432 },
{db_user, "user" },
{db_pass, "easypass" },
{db_name, "mydb" },
{idle_check, 10000},
{column_transforms, []},
{prepared_statements,
{sqerl_rec, statements, [[{app, my_app}]]}}
]},

{pooler, [
{pools, [[{name, sqerl},
{max_count, 10 },
{init_count, 5 },
{start_mfa, {sqerl_client, start_link, []}}]]}
]}

@seth
Copy link
Contributor

seth commented Oct 5, 2014

What is the context in which you are running? Is it possible that the system isn't finding the my_app application? Can you try putting the record names there directly in config (as atoms, rather than the {app, AppName} form) and see what happens?

Alternatively, if you build a full release does it happen there in the same way?

@insiderq
Copy link
Author

insiderq commented Oct 6, 2014

Could you please help me with adding record names directly in config, i didnt understand how to do it after reading readme.
my_app is definetly found by the system, it's modules are working perfectly in a shell after starting. Should my_app to be started before the sqerl?

@seth
Copy link
Contributor

seth commented Oct 7, 2014

Any chance you can make your example app where you are seeing the issue available?

@AxisOfEval
Copy link

@seth I get the same errors that @insiderq is getting. Plus, I followed the instructions to the the book and scoured all the documentation. No luck!

It seems to me that the project README assumes too much and is missing some steps. One such case is the absence of the db_driver_mod setting which is required for sqerl to work.

Edit: Sample application here.

UPDATE: @seth Passing the record names as atoms works. Maybe the README and docs need to be updated if this is going to be the scheme of things in the future.

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

3 participants