Opened 2 years ago

Closed 16 months ago

Last modified 16 months ago

#2997 closed Task (fixed)

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

Reported by: matt Owned by: capedfuzz
Priority: critical Milestone: 1.10 - Piwik 1.10
Component: Core Keywords:
Cc: Sensitive: no

Description (last modified by matt)

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

Change History (11)

comment:1 Changed 22 months ago by matt (mattab)

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

comment:2 Changed 21 months ago by matt (mattab)

  • Description modified (diff)
  • Milestone changed from 1.8.x - Piwik 1.8.x to 1.8.3 - Piwik 1.8.3
  • Priority changed from normal to critical
  • Summary changed from Document known issues and fixes for webhosts (Hostgator, OVH) to Document known issues and Implement auto-fixes for webhosts (Hostgator, OVH)

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!!!

comment:3 Changed 21 months ago by matt (mattab)

  • Owner set to capedfuzz

comment:4 Changed 21 months ago by capedfuzz (diosmosis)

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?

comment:5 Changed 21 months ago by vipsoft (robocoder)

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.

comment:6 Changed 21 months ago by matt (mattab)

  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?

comment:7 Changed 20 months ago by matt (mattab)

  • Description modified (diff)
  • Summary changed from Document known issues and Implement auto-fixes for webhosts (Hostgator, OVH) to OVH Web Host compatibility: detect when file sessions are too slow and use db sessions instead

comment:8 Changed 18 months ago by pete

Please fix +1

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

comment:9 Changed 16 months ago by capedfuzz (diosmosis)

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in [7681].

comment:10 Changed 16 months ago by capedfuzz (diosmosis)

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

comment:11 Changed 16 months ago by capedfuzz (diosmosis)

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

Note: See TracTickets for help on using tickets.