cancel
Showing results for 
Search instead for 
Did you mean: 

Admin Panel Broken: Trying to integrate Magento to ERP (NetSuite) on CentOS 7

SOLVED

Admin Panel Broken: Trying to integrate Magento to ERP (NetSuite) on CentOS 7

Hello everyone,

 

I'm attempting to integrate our blank, newly set up Magento 2.3 Community Edition to our NetSuite's ERP which contains vital important information that needs to synchronize to our system.

 

On NetSuite's end: (Source)

  • I have been made aware of managing Access Tokens, creating designated roles and setting up integration instances.
  • I'm not sure what are the minimal (or essential) permissions that needs to be given to the designated role that will be fetching the stored information.
  • I'm not sure what are the preferred names for the role to be called and the preferred keyword to set for a Token Name

 

On Magento's end: (Destination)

  • No inventory/products exist from NetSuite yet.
  • No customer accounts exist from NetSuite yet.
  • No "return authorisations" (support tickets) exist from NetSuite yet.
  • No sales orders can be created into NetSuite via Magento's platform

 

I have looked through https://community.magento.com/t5/forums/postpage/board-id/programming-magento-2 and follow through it all the way but now I cannot access the Administration Panel with the error message:

 

RuntimeException: Can't create directory /var/www/html/magento/generated/code/Magento/Framework/App/Http/. Class Magento\Framework\App\Http\Interceptor generation error: The requested class did not generate properly, because the 'generated' directory permission is read-only. If --- after running the 'bin/magento setup:di:compile' CLI command when the 'generated' directory permission is set to write --- the requested class did not generate properly, then you must add the generated class object to the signature of the related construct method, only. in /var/www/html/magento/vendor/magento/framework/Code/Generator.php:135 Stack trace: #0 /var/www/html/magento/vendor/magento/framework/Code/Generator/Autoloader.php(35): Magento\Framework\Code\Generator->generateClass('Magento\\Framewo...') #1 [internal function]: Magento\Framework\Code\Generator\Autoloader->load('Magento\\Framewo...') #2 [internal function]: spl_autoload_call('Magento\\Framewo...') #3 /var/www/html/magento/vendor/magento/framework/Code/Reader/ClassReader.php(19): ReflectionClass->__construct('Magento\\Framewo...') #4 /var/www/html/magento/vendor/magento/framework/ObjectManager/Definition/Runtime.php(49): Magento\Framework\Code\Reader\ClassReader->getConstructor('Magento\\Framewo...') #5 /var/www/html/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(48): Magento\Framework\ObjectManager\Definition\Runtime->getParameters('Magento\\Framewo...') #6 /var/www/html/magento/vendor/magento/framework/ObjectManager/ObjectManager.php(56): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...', Array) #7 /var/www/html/magento/vendor/magento/framework/App/Bootstrap.php(234): Magento\Framework\ObjectManager\ObjectManager->create('Magento\\Framewo...', Array) #8 /var/www/html/magento/index.php(38): Magento\Framework\App\Bootstrap->createApplication('Magento\\Framewo...') #9 {main}

Any help would much be appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions

Admin Panel Broken: Due to broken module

Hello @Manthan Dave @gelanivishal,

 

Thanks for you input. I am only running root commands because this development environment is completely isolated in its own and it is not a part of the production environment

 

I fixed my own issue by running the command below:

 chmod -R 777 /var/www/html/magento/pub/media /var/www/html/magento/pub/static /var/www/html/magento/var /var/www/html/magento/generated

Now, I will need to figure out how to create modules differently than described from the existing magento devdocs which got me to this issue.

 

Because the Admin Panel is no longer broken, this thread must be closed.

View solution in original post

8 REPLIES 8

Re: Admin Panel Broken: Trying to integrate Magento to ERP (NetSuite)

Hello @joseph_candava ,

 

There is look like permission issue. Please open terminal and go to magento directory and run below command

mkdir generated
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
find ./var -type d -exec chmod 777 {} \;
find ./pub/media -type d -exec chmod 777 {} \;
find ./pub/static -type d -exec chmod 777 {} \;
chmod 777 ./app/etc
chmod 644 ./app/etc/*.xml
chmod u+x bin/magento

If you still get an issue then let me know

 

--

If my answer is useful, please Accept as Solution & give Kudos

Re: Admin Panel Broken: Trying to integrate Magento to ERP (NetSuite)

After running those commands results in a white screen for both the store front and the admin panel

Re: Admin Panel Broken: Trying to integrate Magento to ERP (NetSuite)

I ran the following command described from https://community.magento.com/t5/Magento-2-x-Technical-Issues/http-error-500-after-disabling-module-...

 

chmod 0777 -R /var/www/html/magento/var/cache

and now the white screen of death (on Mozilla Firefox) / HTTP 500 Error (on Google Chrome) now becomes back to:

RuntimeException: Can't create directory /var/www/html/magento/generated/code/Magento/Framework/App/Http/. Class Magento\Framework\App\Http\Interceptor generation error: The requested class did not generate properly, because the 'generated' directory permission is read-only. If --- after running the 'bin/magento setup:di:compile' CLI command when the 'generated' directory permission is set to write --- the requested class did not generate properly, then you must add the generated class object to the signature of the related construct method, only. in /var/www/html/magento/vendor/magento/framework/Code/Generator.php:135 Stack trace: #0 /var/www/html/magento/vendor/magento/framework/Code/Generator/Autoloader.php(35): Magento\Framework\Code\Generator->generateClass('Magento\\Framewo...') #1 [internal function]: Magento\Framework\Code\Generator\Autoloader->load('Magento\\Framewo...') #2 [internal function]: spl_autoload_call('Magento\\Framewo...') #3 /var/www/html/magento/vendor/magento/framework/Code/Reader/ClassReader.php(19): ReflectionClass->__construct('Magento\\Framewo...') #4 /var/www/html/magento/vendor/magento/framework/ObjectManager/Definition/Runtime.php(49): Magento\Framework\Code\Reader\ClassReader->getConstructor('Magento\\Framewo...') #5 /var/www/html/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(48): Magento\Framework\ObjectManager\Definition\Runtime->getParameters('Magento\\Framewo...') #6 /var/www/html/magento/vendor/magento/framework/ObjectManager/ObjectManager.php(56): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...', Array) #7 /var/www/html/magento/vendor/magento/framework/App/Bootstrap.php(234): Magento\Framework\ObjectManager\ObjectManager->create('Magento\\Framewo...', Array) #8 /var/www/html/magento/index.php(38): Magento\Framework\App\Bootstrap->createApplication('Magento\\Framewo...') #9 {main}

I ran the following code below to no success...

find /var/www/html/magento/var/ -type d -exec chmod 777 {} \;
find /var/www/html/magento/pub/media -type d -exec chmod 777 {} \;
find /var/www/html/magento/pub/static -type d -exec chmod 777 {} \;
chmod 777 /var/www/html/magento/app/etc
chmod 644 /var/www/html/magento/app/etc/*xml
chmod u+x /var/www/html/magento/bin/magento

Re: Admin Panel Broken: Trying to integrate Magento to ERP (NetSuite)

Hello @joseph_candava ,

 

Please make sure developer mode set on store, you can check it by following command

php bin/magento deploy:mode:show

If not then please set developer mode on it

php bin/magento deploy:mode:set developer

After set developer mode, Please deploy static content and above permission command.

 

Also check appropriate user and group to magento file. 

 


--
If my answer is useful, please Accept as Solution & give Kudos

 

Re: Admin Panel Broken: Trying to integrate Magento to ERP (NetSuite)

Hello @joseph_candava 

 

The issue you are facing because of ownership issue - your permission is already set by running the suggested commands !

 

But here you need to give the proper ownership to that specific user - also don't run commands with the Root user - create a new user and give proper permissions and www-data ownership and then try it will works !

 

For more details refer this - https://devdocs.magento.com/guides/v2.3/config-guide/prod/prod_file-sys-perms.html

 

Hope it helps !

if issue solved,Click Kudos & Accept as Solution

Admin Panel Broken: Due to broken module

Hello @Manthan Dave @gelanivishal,

 

Thanks for you input. I am only running root commands because this development environment is completely isolated in its own and it is not a part of the production environment

 

I fixed my own issue by running the command below:

 chmod -R 777 /var/www/html/magento/pub/media /var/www/html/magento/pub/static /var/www/html/magento/var /var/www/html/magento/generated

Now, I will need to figure out how to create modules differently than described from the existing magento devdocs which got me to this issue.

 

Because the Admin Panel is no longer broken, this thread must be closed.

Re: Admin Panel Broken: Due to broken module

Hello @joseph_candava ,

 

Yes, I have checked your all questions. You can take help of all developers and solve your problem with yourself.

 

 

Smiley Happy

Re: Admin Panel Broken: Due to broken module

Hi 

 

Glad to know that you have resolved your issue yourself - happy to help and keep helping others Smiley Happy

if issue solved,Click Kudos & Accept as Solution