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

OVH Web Host compatibility: detect when file sessions are too slow and use db sessions instead #2997

Closed
mattab opened this issue Mar 1, 2012 · 9 comments
Assignees
Labels
Critical Indicates the severity of an issue is very critical and the issue has a very high priority. Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Milestone

Comments

@mattab
Copy link
Member

mattab commented Mar 1, 2012

It is frustrating thing for some users because by default their host does not work with PiwiK: eg. OVH users need to enable DB sessions.

How to fix this issue?

The goal is minimize user frustration and risk to not continue using Piwik because of these known issues.

  • as capedfuzz suggests in the comments " call an AJAX method that would try to do some filesystem operations in /tmp/sessions. If it failed or took too long, we'd say there was an issue and make sure DB sessions would be used. "
  • Document the webhosts affected and the fix for them:
    • in the website (in the Requirements page, installation page)
    • in the FAQ (add a new FAQ for each of these hosts)

Already Discussed in comments:

  • We probably Couldnt enable DB sessions by default, as There were some issues with it and mysql being overloaded by the widget on restrictive hosts. This would be harder to detect than this ticket, probably.
  • could we reverse lookup the hostname during install and show a warning during installer for these 2 hosts? --> Not really this requires external whois service
@mattab
Copy link
Member Author

mattab commented Jun 19, 2012

See also a related ticket, maybe slightly duplicate: #3234

@mattab
Copy link
Member Author

mattab commented Jul 19, 2012

How can we detect the web host effectively?

in the case of OVH this is causing much trouble and lost users. We must try to change the setting during install for OVH users!!!

@diosmosis
Copy link
Member

Regarding DB sessions:

Do you think we could do a test during installation? We could call an AJAX method that would try to do some filesystem operations in /tmp/sessions. If it failed or took too long, we'd say there was an issue and make sure DB sessions would be used. I'm not sure if this would be a reliable way to test, though. You wouldn't happen to have an OVH account, would you?

Regarding mod_security:

  1. Is there a reason GET is used in the tracker instead of POST? Tracking a visit isn't idempotent, right?

I think we can solve this by issuing a fake tracking request to the server during setup. If it fails or times out, the tracking code that gets shown to users will have setRequestMethod('POST') in it.

What do you think?

@robocoder
Copy link
Contributor

Detecting the hosting provider will require an outside service, eg whois. Maybe something we host at api.piwik.org?

The installer already does a GET tracking request. It doesn't always trigger mod security because some users have custom error pages or redirects.

@mattab
Copy link
Member Author

mattab commented Aug 10, 2012

  1. Is there a reason GET is used in the tracker instead of POST? Tracking a visit isn't idempotent, right?

You can't POST to an external domain if piwik is hosted on another domain.

I think we can solve this by issuing a fake tracking request to the server during setup. If it fails or times out, the tracking code that gets shown to users will have setRequestMethod('POST') in it.

unfortunately I think the only way to work around the mod_security issue would be to not pass any URL or http:// in the GET as it seems to trigger the notice. if we removed these from the tracker and did not require the prepend protocol:// in the URLs in APIs, it might work?

We could call an AJAX method that would try to do some filesystem operations in /tmp/sessions.

Good point, we could try to open the session (ie. simulate what fails with the widgets), during the installation. If the file session does not work or reply within N second, we can try to enable DB sessions?

Anthon & Benaka, what are your thoughts?

@anonymous-matomo-user
Copy link

Please fix +1
OVH is very popular and we can't (yet) install Piwik on our cheap hosting there :(

@diosmosis
Copy link
Member

Fixed in [7681].

@diosmosis
Copy link
Member

(In [7690]) Refs #2997, add test for checkIfFilesystemIsNfs.

@diosmosis
Copy link
Member

(In [7695]) Refs #2997, make sure stderr doesn't show up as output in df command.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Critical Indicates the severity of an issue is very critical and the issue has a very high priority. Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Projects
None yet
Development

No branches or pull requests

4 participants