Bug 12800 - Can't access MARC bibliographic frameworks and other pages
Summary: Can't access MARC bibliographic frameworks and other pages
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Robin Sheat
QA Contact: Testopia
URL:
Keywords:
Depends on: 11842
Blocks: 13431
  Show dependency treegraph
 
Reported: 2014-08-21 07:34 UTC by Katrin Fischer
Modified: 2016-06-21 21:37 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 12800: running unit tests that use Koha::Cache breaks cache usage from Apache (3.26 KB, patch)
2014-08-21 18:59 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 12800: running unit tests that use Koha::Cache breaks cache usage from Apache (3.32 KB, patch)
2014-08-22 00:25 UTC, Chris Cormack
Details | Diff | Splinter Review
[PASSED QA] Bug 12800: running unit tests that use Koha::Cache breaks cache usage from Apache (3.39 KB, patch)
2014-08-22 15:20 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2014-08-21 07:34:05 UTC
When trying to access Administration > MARC bilbiographic frameworks, following perl error message is shown:

Open of share file /tmp/sharefile-koha-koha failed: Permission denied at /usr/lib/perl5/Cache/FastMmap.pm line 640.

It seems to be related to the changes done for bug 11842. Without the patch I can access the page without problem.
Comment 1 Katrin Fischer 2014-08-21 07:36:00 UTC
Same happens when you try to access the Koha to MARC mapping page.
Comment 2 Katrin Fischer 2014-08-21 07:40:33 UTC
... or the catalog detail page?
Comment 3 Katrin Fischer 2014-08-21 08:08:41 UTC
Ok, this seems a bit specific to my installation - downgrading severity.

With help of Jonathan we tried following, both fixed the problem:
- removing libcache-fastmmap-perl
- also, reinstalling the module and deleting /tmp/sharefile-koha-*
Comment 4 Katrin Fischer 2014-08-21 09:19:06 UTC
The problem reoccured with the module installed and after having deleted the /tmp files. This time I couldn't run a unit test file and the error message was shown.
Comment 5 Tomás Cohen Arazi (tcohen) 2014-08-21 18:59:54 UTC Comment hidden (obsolete)
Comment 6 Chris Cormack 2014-08-22 00:25:12 UTC Comment hidden (obsolete)
Comment 7 Kyle M Hall (khall) 2014-08-22 15:20:46 UTC
Created attachment 31101 [details] [review]
[PASSED QA] Bug 12800: running unit tests that use Koha::Cache breaks cache usage from Apache

If the user runs:

 $ prove t/Cache.t

with it's system user, two situations can happen:

1) If MEMCACHED_NAMESPACE is set on koha-httpd.xml other than the default 'koha', then
 Apache sets /tmp/sharefile-koha-<namespace> and the problem is not present: running
 the test creates /tmp/sharefile-koha-koha != /tmp/sharefile-koha-<namespace>
=> SUCCESS: no problem

2) If MEMCACHED_NAMESPACE is not set (or eq 'koha'), then there is a permission problem
either running the unit tests, or when using any funcitonality on the UI that needs
Koha::Cache.
Explanation: the one that is run first will set the /tmp/sharefile-koha-koha ownership
so it will be either the dev's sys user, or www-data (or whatever apache is using).

This patch sets a namespace for the unit tests, so there is no collision.

To test:
- On your dev setup, having MEMCACHED_NAMESPACE unset on koha-httpd.conf
- Edit a marc framework. If it fails, remove /tmp/sharefile-koha-koha, and try again
  -> fixed. Now try running
  $ prove t/Cache.t
=> FAIL: test fails because of permission problem
- Apply the patch
- Re-run the test
=> SUCCESS: test passes
Try changing the order, etc.

The temporary file that is used is deleted after the tests are run.

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 8 Tomás Cohen Arazi (tcohen) 2014-08-24 16:31:39 UTC
Patch pushed to master.