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

Error mounting multiple domains #1672

Open
jahagirdar opened this issue Nov 19, 2022 · 2 comments
Open

Error mounting multiple domains #1672

jahagirdar opened this issue Nov 19, 2022 · 2 comments
Labels

Comments

@jahagirdar
Copy link

I have two apps build using dancer2 hosted on two different domains say foo.com and bar.com
I am loading them via a app.psgi file

builder {
    mount 'https://foo.com/'      => foo->to_app;
    mount 'https://bar.com/' => bar->to_app;
    };

Both these apps access databases foodb and bardb each

I am frequently seeing "Error 500" messages while these databases are accessed. On checking the log it is usually because foo is trying to access its tables from bardb or bar is trying to access its tables in foodb.

It looks like the configuration of one app is leaking into another. I am not sure how to debug this. Any hints?

@cromedome
Copy link
Contributor

Can you post some of the errors you are getting and your app configs (sanitized as necessary)? Can you also post the complete app.psgi?

Do both of these apps live in the same directory, or are they in two entirely different directory structures?

@jahagirdar
Copy link
Author

The errors that I currently see in starman.err are

DBD::mysql::db selectall_arrayref failed: Table 'foodb.companies' doesn't exist at /home/starman/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer/Plugin/Database/Core/Handle.pm line 298.

Companies is a table of bardb and is accessed by a route in bar.com

This is followed by a loss of connection to the database and following errors

DBD::mysql::db selectrow_hashref failed: MySQL server has gone away at /home/starman/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer/Plugin/Database/Core/Handle.pm line 303.
Dancer::Plugin::Database::Core::Handle=HASH(0xba5a750) at /home/starman/www/bar/lib/bar.pm line 32.
DBD::mysql::db selectrow_hashref failed: Table 'bardb.users' doesn't exist at /home/starman/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer/Plugin/Database/Core/Handle.pm line 303.

Sanitised configuration files
www.tar.gz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants