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
Matomo Setup Doesn't Work with Planet Scale #19501
Comments
@njfdev, thanks for raising this issue. Currently Matomo doesn't support SSL/TLS during initial configuration as there is no option to specify the various SSL settings in the wizard. The SSL/TLS can only be configured after installation A workaround could be to install Matomo to a local MySQL server, then dump the database and import it into Planet Scale, then edit the A proper fix could be to have the installation wizard detect any |
@bx80 Thank you for your detailed response. I currently using MySQL through Railway which works fine for now (might not scale well in the future). Railway doesn't allow me to access the filesystem of the deployment, therefore I can't edit the I think an SSL option during setup would be very useful because it allows SSL only databases (such as Planet Scale), but also increases security. Maybe SSL should even be the default. Thanks again for your help. |
This issue has been mentioned on Matomo forums. There might be relevant details there: https://forum.matomo.org/t/planetscale-db-compatibility-on-prem/46210/2 |
I was able to get started with PlanetScale & Matomo using the above steps. Sure, it was inconvenient, but considering it's a one time cost I found it an acceptable cost. The much larger blocker to the integration of PlanetScale & Matomo is how upgrading Matomo would work. PlanetScale follows a similar branching strategy to that of GitHub's, except instead of code, it's databases. To make a schema change to a PlanetScale database, you must branch, make the change, and merge back in (you cant make schema changes to main branch). Docs here https://docs.planetscale.com/concepts/branching. However any data changes you make in a branch will not be copied back to main. The problem here is that Matomo is not built to handle this kind of workflow (to no fault of Matomo, this is a somewhat novel concept in the db world). I suppose a solution to this other than an intentional integration on Matomo's side would be to somehow apply schema changes in a branch, merge them to main, then apply any data changes in the main branch. This would be required for the base matomo product as well as all plugins. This could be tricky to manage. |
@llibdude Good to hear you were able to work around the installation issue with some success. A possible workaround for applying Matomo upgrades could be to initiate the upgrade using the console command |
@bx80 I attempted this strategy. I think however, that Matomo will still attempt to run the migration even after the branch has been merged in. PlanetScale will still error out on any |
@llibdude Unfortunately at the moment there is no way to just skip the Checking the schema first before applying database update statements would be a big change to the way Matomo updates curenntly work, as would adding explicit support for Planet Scale's database branching paradigm. Something that might be easier to implement would be to get the updater to ignore the Planet Scale In the Something like:
(but with code(s) loaded from a proper config.ini.php setting, not hardcoded!) If you think this might be an effective approach then I can create a new enhancement request to add this option, as it should be fairly trivial to implement and may be helpful as a workaround for other database services with similar quirks. |
Thanks. I'd be willing to give it a test |
Adding to current milestone as there's an easy solution already implemented that will allow further testing 👍🏽 |
Wrong one, linking the related issue instead of this one now! Thanks for the headsup @bx80 |
There is actually a (obviously unsupported) workaround for installation: monkey-patching the core/Db/Adapter/Pdo/Mysql.php file to:
|
@stephtr As a workaround you could also adjust |
As far as I have understood, that only works once the database is seeded. At least in my case I only managed it to run it after seeding the DB using my workaround. But it can also be that I made a mistake in the first place. |
During setup, the connection to a Planet Scale MySQL database fails.
Expected Behavior
A user should be able to input their Planet Scale credentials and go to the next step in the setup.
Current Behavior
Matomo throws an error on the web interface:
Possible Solution
Matomo should have all connections to the database use SSL/TLS. This would allow databases that only support SSL (such as Planet Scale) to be used.
Steps to Reproduce (for Bugs)
Context
I am trying to self-host Matomo for the first time using Heroku and Planet Scale which both have a free tier. This is useful because I can use my own domain to bypass ad blockers.
Your Environment
The text was updated successfully, but these errors were encountered: