cancel
Showing results for 
Search instead for 
Did you mean: 

Magento Page Builder - 500 Internal Server error

SOLVED

Magento Page Builder - 500 Internal Server error

 

I just wanted to add a Slider block in my Magento 2.4.4 build in Pagebuilder and I'm getting an 500 Internal Server error in my browser console when I click on Edit. I have this problem also with the Image block.

 

I have this in my browser console:

https://example.com/admin/mui/index/render_handle/buttons/1/key/3d12a8a6a2372ed459fc9684018ea6fbb954... [HTTP/1.1 500 Internal Server Error 887ms]

 

Do you know where I can start to search where this is comming from?

 

The debug.log and system.log says: magento main.ERROR: The requested store cannot be found.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Magento Page Builder - 500 Internal Server error

I found the solution folowing the steps from Silas Palmer found here: https://magento.stackexchange.com/questions/156176/magento-2-requested-store-is-not-found?newreg=9ac...

 

That makes the error code more clear.

 

In my case it says:

main.ERROR: The store ID (3) that was requested wasn't found. Verify the store and try again.

So I crated a new store view and it works now.

 

Here is what I did:

This generally happens whenever config.php and the database get out of sync. For example, whenever I import a database back to my local development environment.

Here were the steps I used to troubleshoot and fix this.

  1. Make the error messages more helpful:

Change vendor/magento/module-store/Model/StoreRepository.php to this (on your local, temporarily)

// Around line 74
        if ($store->getId() === null) {
        
// Add this to see a backtrace
            // debug_print_backtrace();            

// Add this to see the store code causing the issue: (code:{$code})
            throw new NoSuchEntityException(
                __("The store (code:{$code}) that was requested wasn't found. Verify the store and try again.")
            );
        }
        
// .......
// Around line 114, same kind of thing...

        if ($store->getId() === null) {

            // debug_print_backtrace();

            throw new NoSuchEntityException(
                __("The store ID ({$id}) that was requested wasn't found. Verify the store and try again.")
            );
        }        

Run php bin/magento s:up and make a note of the store id and/or store codes that are causing the issues. If you have added the backtrace, that will spool variables forever and you might need to do something like this instead: php bin/magento s:up > output.txt (wait 3 minutes, press ctrl-d to kill it) less output.txt

  1. Go through app/etc/config.php and make sure all the stores line up with whatever is in the store table in the database. Note the store id from step 1, that will give you clues where to look. If there are differences, change config.php and not the database.

  2. Run this against the database:

## Change scope_id value (99) to whatever store_id you got in step #1
DELETE FROM `core_config_data` WHERE scope_id = 99

## Change like value ('%xx_en%') to whatever store code you got in step #1
DELETE from flag where flag_data like '%xx_en%'
  1. Run php bin/magento s:up again, hopefully there are no errors this time. Otherwise you may have to repeat some steps.

View solution in original post

1 REPLY 1

Re: Magento Page Builder - 500 Internal Server error

I found the solution folowing the steps from Silas Palmer found here: https://magento.stackexchange.com/questions/156176/magento-2-requested-store-is-not-found?newreg=9ac...

 

That makes the error code more clear.

 

In my case it says:

main.ERROR: The store ID (3) that was requested wasn't found. Verify the store and try again.

So I crated a new store view and it works now.

 

Here is what I did:

This generally happens whenever config.php and the database get out of sync. For example, whenever I import a database back to my local development environment.

Here were the steps I used to troubleshoot and fix this.

  1. Make the error messages more helpful:

Change vendor/magento/module-store/Model/StoreRepository.php to this (on your local, temporarily)

// Around line 74
        if ($store->getId() === null) {
        
// Add this to see a backtrace
            // debug_print_backtrace();            

// Add this to see the store code causing the issue: (code:{$code})
            throw new NoSuchEntityException(
                __("The store (code:{$code}) that was requested wasn't found. Verify the store and try again.")
            );
        }
        
// .......
// Around line 114, same kind of thing...

        if ($store->getId() === null) {

            // debug_print_backtrace();

            throw new NoSuchEntityException(
                __("The store ID ({$id}) that was requested wasn't found. Verify the store and try again.")
            );
        }        

Run php bin/magento s:up and make a note of the store id and/or store codes that are causing the issues. If you have added the backtrace, that will spool variables forever and you might need to do something like this instead: php bin/magento s:up > output.txt (wait 3 minutes, press ctrl-d to kill it) less output.txt

  1. Go through app/etc/config.php and make sure all the stores line up with whatever is in the store table in the database. Note the store id from step 1, that will give you clues where to look. If there are differences, change config.php and not the database.

  2. Run this against the database:

## Change scope_id value (99) to whatever store_id you got in step #1
DELETE FROM `core_config_data` WHERE scope_id = 99

## Change like value ('%xx_en%') to whatever store code you got in step #1
DELETE from flag where flag_data like '%xx_en%'
  1. Run php bin/magento s:up again, hopefully there are no errors this time. Otherwise you may have to repeat some steps.