Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-23272

Wrong usage of environments and SPI cache can lead to exceptions

    XMLWordPrintable

Details

    • Castor Core S6, Castor Core S7

    Description

      We must document that using the same environment is critical when persistence cache is involved. If two executions, using the same repository, don't use the same cache storage, inconsistencies may lead to exceptions from the SPI, as described below.


      When an content object is moved to a new location, and the original parent is removed, attempting to generate it's alias/route will result in an exception.

      The problem only occurs in prod environment, which indicates a SPI cache issue.

      Steps to reproduce
      1. Create folder "A "
      2. Create content object "Test" under folder "A"
      3. Run the test command with --env=prod
      4. Move "Test" content to root location "Home".
      5. Remove folder "A"
      6. Run the test command once more in prod.
      Test Command:
          protected function configure()
          {
              $this->setName( 'test:urlalias' )
                  ->addArgument( 'locationId', InputArgument::REQUIRED, 'location Id.' );
          }
      
          /**
           * @param InputInterface $input Predefined parameter for commands
           * @param OutputInterface $output Predefined parameter for commands
           */
          protected function execute( InputInterface $input, OutputInterface $output )
          {
              $repository = $this->getContainer()->get( 'ezpublish.api.repository' );
      
              // login admin user
              $repository->setCurrentUser( $repository->getUserService()->loadUser( 14 ) );
      
              $locationId = $input->getArgument( 'locationId' );
      
              $router = $this->getContainer()->get( 'router' );
              print_r( $router->generate( 'ez_urlalias', array( 'locationId' => $locationId ) ) );
          }
      
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            joao.inacio-obsolete@ez.no Joao Inacio (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours
                2h