Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Closed
mattab opened this Issue · 9 comments

4 participants

@mattab
Owner

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
Owner

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

@mattab
Owner

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
Collaborator

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
Collaborator

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
Owner
  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-piwik-user

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

@diosmosis
Collaborator

Fixed in [7681].

@diosmosis
Collaborator

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

@diosmosis
Collaborator

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

@mattab mattab added this to the 1.10 - Piwik 1.10 milestone
@diosmosis diosmosis was assigned by mattab
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.