Uploaded image for project: 'LAMS Development'
  1. LAMS Development
  2. LDEV-723

Import LD with attachments can cause bad repository tickets


    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 2.0 Beta 1
    • Fix Version/s: 2.4
    • Component/s: Content Repository
    • Labels:



      * Rebuild LAMS and clear the database.
      * Start LAMS.
      * Without doing anything else, log in and import the attached "files.zip" design. This design has most of the tools, and each one has instruction attachments.
      * This will fail due to a change in the noticeboard table - and the db transation will be marked for rollback. As we use one shared db session for the whole import, the database changes will be rolled back, including the new credential records.
      * Now create a design with a noticeboard, with an instructions file and save the design. Export the design.
      * The export will fail as the workspace id in the database doesn't match the workspace id in the ticket and the content repository sees that as a security violation.

      This won't happen very often but it does hightlight a potential flaw with how the repository tickets work. The problem is that it is creating new ticket and credential in the repository but the credential gets rolled back. But the ticket is cached in memory (for performance reasons). Next time someone tries to use the ticket, it won't match the repository as the matching credential record doesn't exist!

      The tickets are cached, so the problem stays until the server is restarted. Restarting the server fixes the temporarily. Once all the tools have a credential in the database, the problem won't reoccur.

      Just putting the credential creation in its own transation probably won't help as the Hibernate session is being kept open by the valve, and hence we only have one real transation with the database.

      An easy fix would be to remove the credential check but that's just removing security to make coding easier.

      A better fix might be to run something on startup that creates all the tool's credentials (if they don't already exist). Maybe we need an initialisation task to be add to LAMS startup, or possibly add support for the content repository tables to the tool deployer and add the credential when the tool is deployed.


        There are no comments yet on this issue.


          • Assignee:
            ernieg Ernie Ghiglione
            fionam Fiona Malikoff
          • Votes:
            0 Vote for this issue
            0 Start watching this issue


            • Created: