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

Refusing clobbering of {HandleError} installed on externally supplied DBI handle #57

Open
onelesd opened this issue Oct 15, 2014 · 3 comments

Comments

@onelesd
Copy link

onelesd commented Oct 15, 2014

Not sure which module to blame here. But the error goes away by commenting this section of Dancer::Plugin::Database::Core.pm

    # To support the database_error hook, use DBI's HandleError option
    #$settings->{dbi_params}{HandleError} = sub {
    #    my ($error, $handle) = @_;
    #    $hook_exec->('database_error', $error, $handle);
    #};

[20564] error @0.028260> [hit #1]request to GET /login crashed: DBIx::Class::Storage::DBI::catch {...} (): DBI Connection failed: DBIx::Class::Storage::DBI::try {...} (): Refusing clobbering of {HandleError} installed on externally supplied DBI handle Dancer::Plugin::Database::Core::Handle=HASH(0x9101c68). Either remove the handler or use the 'unsafe' attribute. at /opt/my-app/lib/App.pm line 247 at /opt/my-app/lib/App.pm line 247 in /usr/local/share/perl/5.14.2/Dancer/Handler.pm l. 101

@bigpresh
Copy link
Owner

Sorry for the slow response - looks like both Dancer::Plugin::Database and something else in your app are setting HandleError.

Maybe Dancer::Plugin::Database should provide an option to disable the error hook handler if you don't need it?

@joshrabinowitz
Copy link
Contributor

@bigpresh This just hit me when using DBIx::Class on an existing dbh inside Dancer - I worked around by creating a second dbh connection (which I'm not enamored with, because I don't like doubling my database connections). Going to look into submitting a patch to provide an option to disable the error hook handler. Please let me know if you have input

@KES777
Copy link

KES777 commented Jul 24, 2018

I get same error. I do not use two connections. I even do not know which module may take precedence to setting up handler second time.

*** cross link

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

4 participants