5

I am getting below error when I ran php bin/magento setup:static-content:deploy -f cmd.

frontend/Alothemes/digitalstore3/en_US  2494/2645           ==========================>- 94%    5 secs
Compilation from source /var/www/mag2/app/design/frontend/Alothemes/digitalstore1/web/images/flags/german.jpg failed
Magento\Framework\View\Asset\File\NotFoundException: Unable to resolve the source file for 'frontend/Alothemes/digitalstore3/en_US/images/flags/german.jpg' in /var/www/mag2/vendor/magento/framework/View/Asset/File.php:160
Stack trace:
#0 /var/www/mag2/vendor/magento/framework/App/View/Asset/Publisher.php(74): Magento\Framework\View\Asset\File->getSourceFile()
#1 /var/www/mag2/vendor/magento/framework/App/View/Asset/Publisher.php(62): Magento\Framework\App\View\Asset\Publisher->publishAsset(Object(Magento\Framework\View\Asset\File))
#2 /var/www/mag2/vendor/magento/module-deploy/Service/DeployStaticFile.php(89): Magento\Framework\App\View\Asset\Publisher->publish(Object(Magento\Framework\View\Asset\File))
#3 /var/www/mag2/vendor/magento/module-deploy/Service/DeployPackage.php(189): Magento\Deploy\Service\DeployStaticFile->deployFile('images/flags/ge...', Array)
#4 /var/www/mag2/vendor/magento/module-deploy/Service/DeployPackage.php(133): Magento\Deploy\Service\DeployPackage->processFile(Object(Magento\Deploy\Package\PackageFile), Object(Magento\Deploy\Package\Package))
#5 /var/www/mag2/vendor/magento/module-deploy/Service/DeployPackage.php(102): Magento\Deploy\Service\DeployPackage->deployEmulated(Object(Magento\Deploy\Package\Package), Array, false)
#6 [internal function]: Magento\Deploy\Service\DeployPackage->Magento\Deploy\Service\{closure}()
#7 /var/www/mag2/vendor/magento/framework/App/State.php(187): call_user_func_array(Object(Closure), Array)
#8 /var/www/mag2/generated/code/Magento/Framework/App/State/Interceptor.php(89): Magento\Framework\App\State->emulateAreaCode('frontend', Object(Closure), Array)

I am using a third party theme for my store which is https://themeforest.net/item/digitalstore-responsive-magento-1-2-theme/19685939.

I have no idea, How can I resolve this error.enter image description here

Magento ver. : 2.3.5-p1

Any help?

2
  • did you resolve this problem? I have same issue now and I think the problem come from theme
    – huykon225
    Commented Aug 26, 2020 at 14:35
  • @huykon225 : Please check my answer. I hope it will help you. Commented Aug 27, 2020 at 10:32

7 Answers 7

9

I have resolved my issue to set value 0 in 'theme' table in db for type column.enter image description here

2
  • 2
    Theme is already type value 0 in my case this does not fix it. Commented Sep 15, 2020 at 2:08
  • 2
    same here. error is no fixed
    – Ali Raza
    Commented Oct 7, 2021 at 13:14
5

Just in case someone else runs in to this still: For us, the parent_id:s of our custom themes were all kinds of messed up, showing up all as parent_id=1; Fixing the parent_id's from "theme"-table fixed the issue.

f.ex.

+----------+-----------+-------------------------+
| theme_id | parent_id | theme_path              |
+----------+-----------+-------------------------+
|        1 |      NULL | Magento/blank           |
|        2 |      NULL | Magento/backend         |
|        3 |         1 | Magento/luma            |
|        4 |         1 | 3rdpartyVendor/base     |
|        5 |         1 | 3rdpartyVendor/child    |
|        6 |         1 | Vendor/frontendtheme    |
|        7 |         2 | Vendor/admintheme       |
+----------+-----------+-------------------------+

Switching to correct parents fixed the issue:

+----------+-----------+-------------------------+
| theme_id | parent_id | theme_path              |
+----------+-----------+-------------------------+
|        1 |      NULL | Magento/blank           |
|        2 |      NULL | Magento/backend         |
|        3 |         1 | Magento/luma            |
|        4 |         1 | 3rdpartyVendor/base     |
|        5 |         4 | 3rdpartyVendor/child    |
|        6 |         5 | Vendor/frontendtheme    |
|        7 |         2 | Vendor/admintheme       |
+----------+-----------+-------------------------+
2

Run these commands in the order shown and the issue should be solved

php bin/magento cache:clean
php bin/magento cache:flush
rm -rf pub/static/frontend/* pub/static/adminhtml/*
php bin/magento setup:static-content:deploy -f

the issue is a cache issue, nothing more

1
  • Why do you call cache:clean and then cache.flush?
    – Black
    Commented Aug 2 at 14:11
1

You need to update the type from the theme table, which may be changed. Please run below SQL

update theme set type=0;

enter image description here

Also Please check your selected theme on Admin

enter image description here

After that, you need to run the below magento command.

php bin/magento setup:upgrade
php bin/magento s:s:d -f 
php bin/magento cache:clean

Note: If it's still not working then please remove your custom theme entry from the theme table and run the above magento command again. And also select the theme from the admin again.

0

You miss this german.jpg file. If you add this file in your ftp, in the correct directory, it will be solved.

2
  • i have the file but still error.
    – Ali Raza
    Commented Oct 7, 2021 at 13:14
  • Same theme? Same Magento version and same error?
    – Gijsve
    Commented Oct 8, 2021 at 14:12
0

check logs after run command if completed successfully php bin/magento setup:upgrade

0

After creating my personalized theme, I executed the "bin/magento setup:static-content:deploy -f" command, however errors similar to those described here were generated.

After many unsuccessful attempts I realized that I had not registered the personalized theme in the database.

To solve it, I executed the following commands:

1 - bin/magento setup:upgrade

2 - bin/magento setup:di:compile

3 - bin/magento setup:static-content:deploy -f

This registers the personalized tempate in the database

Problem solved in Magento 2.4.6-P5

I hope this helps those who have the same problem currently

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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