1

I am a front end designer building my site locally. This is the first time I've built in Craft and things have been coming along fine but now I'm getting the following error on every craft admin page and I'm not sure what's happened or how to fix it.

Twig\Error\SyntaxError: The block 'content' has already been defined line 256. in /Users/jinora/sites/janahoffmann/_repo/v4/vendor/craftcms/cms/src/templates/_layouts/cp.html:274

The front end of the site seems fine and still loads all the templates and entries.

I had just changed an asset field to use a different folder and they weren't loading on the front end so I went into utilities and tried clearing the database cache and that's when the admin stopped working.

I had recently named a block in my templates 'content' but it had been working fine for a little while and I tried renaming the block but that didn't fix anything.

I had noticed that there was a new craft update but hadn't got to it before so I tried using terminal to update it as per this docs page (since I can't get to the control panel update) https://docs.craftcms.com/v3/updating.html#updating-from-the-control-panel. Weirdly it says the following...

Craft isn’t installed yet!    

Fetching available updates ... done You’re all up-to-date!

I took back ups and then tried clearing the storage/runtime/cache and compiled_templates folders, I restarted mamp and closed the browser but still nothing. I haven't messed around with anything outside the web or templates folder before this so I'm completely stumped as to what's happened and how to fix it.

Can anyone point me in the right direction?

  • Weird... what version of Craft? If you have composer installed from the command line, can you run composer update from your project's root, let that finish and see if that helps? – Brad Bell Feb 5 at 2:14
  • I'm not entirely sure how to tell what version I have without being able to access the diagnostic page, but since I had 1 update alert before the crash I'd say it's 3.4.2? I did do a composer install. I'm at work now but I'll try it as soon as I get home. Thanks! – Jana Feb 5 at 2:56
  • I've run the composer update and that hasn't changed anything unfortunately, I still get "Craft isn’t installed yet! Fetching available updates ... done You’re all up-to-date!" and when I try ./craft update the admin is still errors after login. I remembered that I had trouble with the final composer installation instructions following the CraftQuest course & I missed instructions on moving composer on MacOS if you have trouble. I had installed, used & run craft updates from in the CMS so I'm not sure if that's relevant but I've reinstalled and moved composer to the right spot now anyway. – Jana Feb 5 at 10:38
1

Sorted YAY!

In case this is helpful to anyone, I tried deleting and reinstalling via composer then replacing the config and .env files but no luck there so I downloaded the latest version and updated just the vendor folder. It needed to update the database which it couldn't do for me so I took a manual backup and let it do it's thing and now it's all working again!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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