0

This question already has an answer here:

I have been following a guide for creating a custom form in Magento V-2.x and at the end, I ought to :

I am on windows server

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento cache:flush

But at the upgrade and compile commands I am getting the following errors:

    # php bin/magento setup:upgrade
    Cache cleared successfully
    File system cleanup:
    C:/xampp/htdocs/magento2/generated/code/Composer
    C:/xampp/htdocs/magento2/generated/code/Dotdigitalgroup
    C:/xampp/htdocs/magento2/generated/code/Infortis
    C:/xampp/htdocs/magento2/generated/code/Magento
    C:/xampp/htdocs/magento2/generated/code/Mageplaza
    C:/xampp/htdocs/magento2/generated/code/Shopial
    C:/xampp/htdocs/magento2/generated/code/Symfony
    C:/xampp/htdocs/magento2/generated/code/Temando
    C:/xampp/htdocs/magento2/generated/metadata/adminhtml.php
    C:/xampp/htdocs/magento2/generated/metadata/crontab.php
    C:/xampp/htdocs/magento2/generated/metadata/frontend.php
    C:/xampp/htdocs/magento2/generated/metadata/global.php
    C:/xampp/htdocs/magento2/generated/metadata/webapi_rest.php
    C:/xampp/htdocs/magento2/generated/metadata/webapi_soap.php
    C:/xampp/htdocs/magento2/pub/static/adminhtml
    C:/xampp/htdocs/magento2/pub/static/deployed_version.txt
    C:/xampp/htdocs/magento2/pub/static/frontend
    C:/xampp/htdocs/magento2/var/view_preprocessed/pub
    The directory "C:/xampp/htdocs/magento2/var/view_preprocessed/pub/static/fronten
    d/Infortis/base/el_GR" cannot be deleted Warning!rmdir(C:/xampp/htdocs/magento2/
    var/view_preprocessed/pub/static/frontend/Infortis/base/el_GR): Resource tempora
    rily unavailable
    Updating modules:...

AND

    # php bin/magento setup:di:compile
    Compilation was started.
    %message% 0/7 [>---------------------------]   0% < 1 sec 42.0 MiB%message% 0/7
    [>---------------------------]   0% < 1 sec 42.0 MiBProxies code generation... 0
    /7 [>---------------------------]   0% < 1 sec 42.0 MiB
    Proxies code generation... 1/7 [====>-----------------------]  14% < 1 sec 46.0
    MiB
    Repositories code generation... 1/7 [====>-----------------------]  14% < 1 sec
    46.0 MiB
    Repositories code generation... 2/7 [========>-------------------]  28% 21 secs
    144.0 MiB
    Service data attributes generation... 2/7 [========>-------------------]  28% 21
    secs 144.0 MiB
    Service data attributes generation... 3/7 [============>---------------]  42% 21
    secs 144.0 MiB
    Application code generator... 3/7 [============>---------------]  42% 21 secs 14
    4.0 MiB
    Application code generator... 4/7 [================>-----------]  57% 49 secs 16
    4.0 MiB
    Interceptors generation... 4/7 [================>-----------]  57% 49 secs 164.0
    MiB
    Interceptors generation... 5/7 [====================>-------]  71% 1 min 178.0 M
    iB
    Area configuration aggregation... 5/7 [====================>-------]  71% 1 min
    178.0 MiB
    Area configuration aggregation... 6/7 [========================>---]  85% 1 min
    228.0 MiB
    Interception cache generation... 6/7 [========================>---]  85% 1 min 2
    28.0 MiBErrors during compilation:
            Mageplaza\Blog\Model\ResourceModel\Post\Grid\Collection
                    Incompatible argument type: Required type: \Magento\Framework\DB
    \Adapter\AdapterInterface. Actual type: \Mageplaza\Blog\Model\ResourceModel\Post
    \Grid\connection; File:
    C:/xampp/htdocs/magento2/vendor/mageplaza/magento-2-blog-extension/Model/Resourc
    eModel/Post/Grid/Collection.php

            Mageplaza\Blog\Model\ResourceModel\Tag\Grid\Collection
                    Incompatible argument type: Required type: \Magento\Framework\DB
    \Adapter\AdapterInterface. Actual type: \Mageplaza\Blog\Model\ResourceModel\Tag\
    Grid\connection; File:
    C:/xampp/htdocs/magento2/vendor/mageplaza/magento-2-blog-extension/Model/Resourc
    eModel/Tag/Grid/Collection.php

            Mageplaza\Blog\Model\ResourceModel\Topic\Grid\Collection
                    Incompatible argument type: Required type: \Magento\Framework\DB
    \Adapter\AdapterInterface. Actual type: \Mageplaza\Blog\Model\ResourceModel\Topi
    c\Grid\connection; File:
    C:/xampp/htdocs/magento2/vendor/mageplaza/magento-2-blog-extension/Model/Resourc
    eModel/Topic/Grid/Collection.php

    Total Errors Count: 3


    [Magento\Framework\Validator\Exception]
    Error during compilation


    setup:di:compile

However, I was getting the errors even before following the guide.

Thus I can't really understand what is causing this. I am currently in developer mode with all the cache enabled (even though this was happening even with disabled cache).

Any help would be awesome and I would gladly report back with further information.

TY

EDIT:

So the first error with the upgrade command was solved using Resource Monitor on windows. It wasn't a permissions problem, it was a cmd prompt open on that location and it couldn't delete the folder.

But besides that, I still have the second problem in which I can't compile. The second error persists.

EDIT 2:

Now after re-deploying the static content, the site isn't loading and I am getting this:

Fatal error: Uncaught Error: Call to a member function setActive() on boolean in C:\xampp\htdocs\magento2\vendor\magento\module-backend\Model\View\Result\Page.php:27 Stack trace: #0 C:\xampp\htdocs\magento2\vendor\magento\module-backend\Controller\Adminhtml\Dashboard\Index.php(35): Magento\Backend\Model\View\Result\Page->setActiveMenu('Magento_Backend...') #1 C:\xampp\htdocs\magento2\vendor\magento\framework\App\Action\Action.php(107): Magento\Backend\Controller\Adminhtml\Dashboard\Index->execute() #2 C:\xampp\htdocs\magento2\vendor\magento\module-backend\App\AbstractAction.php(229): Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http)) #3 C:\xampp\htdocs\magento2\vendor\magento\framework\App\FrontController.php(55): Magento\Backend\App\AbstractAction->dispatch(Object(Magento\Framework\App\Request\Http)) #4 C:\xampp\htdocs\magento2\vendor\magento\framework\App\Http.php(135): Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http)) #5 C:\xampp\htdocs\ma in C:\xampp\htdocs\magento2\vendor\magento\module-backend\Model\View\Result\Page.php on line 27

marked as duplicate by Manoj Deswal, Jai, Piyush, Manashvi Birla, Priyank Mar 26 '18 at 13:15

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • check el_GR folder exist C:/xampp/htdocs/magento2/ var/view_preprocessed/pub/static/frontend/Infortis/base/el_GR – Sourav Mar 26 '18 at 10:43
  • I did. After the setup:upgrade is empty. However, when I re-deploy it gets filled with data. – SUPERDEVELOPER Mar 26 '18 at 10:45
  • As you mentioned you are on windows server try to delete the folders inside var manually ( not .htaccess file) – inrsaurabh Mar 26 '18 at 10:50
  • may be issue C:/ drive that window installation drive. Please check with other drive. – Sourav Mar 26 '18 at 10:56
  • It wasn't a permissions error, but a cmd prompt was using that folder. – SUPERDEVELOPER Mar 26 '18 at 11:21
0

Give permissions for the folder pub/static.

sudo chmod 777 -R pub/static var/ pub/media vendor/

On performing upgrade the contents of pub/static folder is removed and the error occurs because the folder doesn't have the required permissions

  • 1
    But i think there is not need to setup permission because xamp running on window. – Sourav Mar 26 '18 at 10:39
  • Never give 777 permissions – inrsaurabh Mar 26 '18 at 10:40
  • Yes - The server is served from a Windows Server -2008. What can be done? – SUPERDEVELOPER Mar 26 '18 at 10:43
  • Oh yes that's right. If it's windows it should not be permission issue – Geethika Antony Mar 26 '18 at 11:03

Not the answer you're looking for? Browse other questions tagged or ask your own question.