Website encountered an unexpected error. Try again later

I keep getting this error: The website encountered an unexpected error. Try again later. as I navigate the majority of the features eg Records > asserts > any assert will give me that error

How Can I resolve this

1 Like

Should we assume you are self hosting? What does your “stack” look like? (e.g. docker, tarball on shared hosting, etc) Do you have access to the drush command?

Is this a fresh installation - or have you maybe done any updates recently?

1 Like

Sorry for the late response, Im using shared hosting cPanel and its a fresh installation done 12 days ago.

1 Like

Welcome to the community forum @Abraham!

The website encountered an unexpected error. Try again later.

Are you able to get to Administration > Reports > Recent log messages? That may show you more details about the errors. If that doesn’t work, the Apache server logs should include the details. Please copy and paste the error message(s) here and I’ll be happy to provide suggestions.


Please find attached Recent log error messages

You might already be working on this, but please click on one of those error log messages and provide a screenshot of it too. :smiley:

#0 [internal function]: Drupal\asset\Entity\Asset::getWorkflowId(Object(Drupal\asset\Entity\Asset))
#1 /home/jffcozw/public_html/farm/web/modules/state_machine/src/Plugin/Field/FieldType/StateItem.php(257): call_user_func(Array, Object(Drupal\asset\Entity\Asset))
#2 /home/jffcozw/public_html/farm/web/modules/state_machine/src/Plugin/Field/FieldType/StateItem.php(132): Drupal\state_machine\Plugin\Field\FieldType\StateItem->getWorkflow()
#3 /home/jffcozw/public_html/farm/web/core/lib/Drupal/Core/Field/FieldItemList.php(178): Drupal\state_machine\Plugin\Field\FieldType\StateItem->applyDefaultValue(false)
#4 /home/jffcozw/public_html/farm/web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(271): Drupal\Core\Field\FieldItemList->applyDefaultValue()
#5 /home/jffcozw/public_html/farm/web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(129): Drupal\Core\Entity\ContentEntityStorageBase->initFieldValues(Object(Drupal\asset\Entity\Asset), Array)
#6 /home/jffcozw/public_html/farm/web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(94): Drupal\Core\Entity\ContentEntityStorageBase->doCreate(Array)
#7 /home/jffcozw/public_html/farm/web/modules/state_machine/src/Plugin/views/filter/State.php(143): Drupal\Core\Entity\ContentEntityStorageBase->create(Array)
#8 /home/jffcozw/public_html/farm/web/modules/state_machine/src/Plugin/views/filter/State.php(77): Drupal\state_machine\Plugin\views\filter\State->getWorkflows(Object(Drupal\Core\Entity\ContentEntityType), ‘status’)
#9 /home/jffcozw/public_html/farm/web/core/modules/views/src/Plugin/views/filter/InOperator.php(183): Drupal\state_machine\Plugin\views\filter\State->getValueOptions()
#10 /home/jffcozw/public_html/farm/web/core/modules/views/src/Plugin/views/filter/FilterPluginBase.php(1074): Drupal\views\Plugin\views\filter\InOperator->valueForm(Array, Object(Drupal\Core\Form\FormState))
#11 /home/jffcozw/public_html/farm/web/core/modules/views/src/Form/ViewsExposedForm.php(104): Drupal\views\Plugin\views\filter\FilterPluginBase->buildExposedForm(Array, Object(Drupal\Core\Form\FormState))
#12 [internal function]: Drupal\views\Form\ViewsExposedForm->buildForm(Array, Object(Drupal\Core\Form\FormState))
#13 /home/jffcozw/public_html/farm/web/core/lib/Drupal/Core/Form/FormBuilder.php(536): call_user_func_array(Array, Array)
#14 /home/jffcozw/public_html/farm/web/core/lib/Drupal/Core/Form/FormBuilder.php(284): Drupal\Core\Form\FormBuilder->retrieveForm(‘views_exposed_f…’, Object(Drupal\Core\Form\FormState))
#15 /home/jffcozw/public_html/farm/web/core/modules/views/src/Plugin/views/exposed_form/ExposedFormPluginBase.php(134): Drupal\Core\Form\FormBuilder->buildForm(‘\Drupal\views\F…’, Object(Drupal\Core\Form\FormState))
#16 /home/jffcozw/public_html/farm/web/core/modules/views/src/ViewExecutable.php(1298): Drupal\views\Plugin\views\exposed_form\ExposedFormPluginBase->renderExposedForm()
#17 /home/jffcozw/public_html/farm/web/core/modules/views/src/Plugin/views/display/PathPluginBase.php(393): Drupal\views\ViewExecutable->build()
#18 /home/jffcozw/public_html/farm/web/core/modules/rest/src/Plugin/views/display/RestExport.php(424): Drupal\views\Plugin\views\display\PathPluginBase->execute()
#19 /home/jffcozw/public_html/farm/web/core/modules/views/src/ViewExecutable.php(1690): Drupal\rest\Plugin\views\display\RestExport->execute()
#20 /home/jffcozw/public_html/farm/web/core/modules/views/src/Element/View.php(81): Drupal\views\ViewExecutable->executeDisplay(‘full’, Array)
#21 [internal function]: Drupal\views\Element\View::preRenderViewElement(Array)
#22 /home/jffcozw/public_html/farm/web/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(113): call_user_func_array(Array, Array)
#23 /home/jffcozw/public_html/farm/web/core/lib/Drupal/Core/Render/Renderer.php(875): Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, ‘Render #pre_ren…’, ‘exception’, ‘Drupal\Core\Ren…’)
#24 /home/jffcozw/public_html/farm/web/core/lib/Drupal/Core/Render/Renderer.php(432): Drupal\Core\Render\Renderer->doCallback(‘#pre_render’, Array, Array)
#25 /home/jffcozw/public_html/farm/web/core/lib/Drupal/Core/Render/Renderer.php(248): Drupal\Core\Render\Renderer->doRender(Array, true)
#26 /home/jffcozw/public_html/farm/web/core/lib/Drupal/Core/Render/Renderer.php(153): Drupal\Core\Render\Renderer->render(Array, true)
#27 /home/jffcozw/public_html/farm/web/core/lib/Drupal/Core/Render/Renderer.php(638): Drupal\Core\Render\Renderer->Drupal\Core\Render{closure}()
#28 /home/jffcozw/public_html/farm/web/core/lib/Drupal/Core/Render/Renderer.php(152): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#29 /home/jffcozw/public_html/farm/web/core/modules/rest/src/Plugin/views/display/RestExport.php(409): Drupal\Core\Render\Renderer->renderRoot(Array)
#30 /home/jffcozw/public_html/farm/web/core/modules/views/src/Routing/ViewPageController.php(56): Drupal\rest\Plugin\views\display\RestExport::buildResponse(‘farm_asset_geoj…’, ‘full’, Array)
#31 [internal function]: Drupal\views\Routing\ViewPageController->handle(‘farm_asset_geoj…’, ‘full’, Object(Drupal\Core\Routing\RouteMatch))
#32 /home/jffcozw/public_html/farm/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#33 /home/jffcozw/public_html/farm/web/core/lib/Drupal/Core/Render/Renderer.php(638): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber{closure}()
#34 /home/jffcozw/public_html/farm/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(121): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#35 /home/jffcozw/public_html/farm/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#36 /home/jffcozw/public_html/farm/vendor/symfony/http-kernel/HttpKernel.php(181): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber{closure}()
#37 /home/jffcozw/public_html/farm/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#38 /home/jffcozw/public_html/farm/web/modules/simple_oauth/src/HttpMiddleware/BasicAuthSwap.php(54): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#39 /home/jffcozw/public_html/farm/web/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Drupal\simple_oauth\HttpMiddleware\BasicAuthSwap->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#40 /home/jffcozw/public_html/farm/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#41 /home/jffcozw/public_html/farm/web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#42 /home/jffcozw/public_html/farm/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\Core\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#43 /home/jffcozw/public_html/farm/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#44 /home/jffcozw/public_html/farm/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#45 /home/jffcozw/public_html/farm/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#46 /home/jffcozw/public_html/farm/web/core/lib/Drupal/Core/DrupalKernel.php(741): Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#47 /home/jffcozw/public_html/farm/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#48 {main}

1 Like

Error : Call to a member function getWorkflowId() on null in Drupal\asset\Entity\Asset::getWorkflowId() (line 283)

That error is somewhat mysterious. It’s been reported before but we haven’t been able to figure out exactly what causes it. It seems that sometimes it is a result of something that broke during installation.

If this is a fresh instance without any real data then I would suggest trying to reinstall from scratch. Delete the database and the farmOS codebase and follow the installation instructions again from the beginning, following the official guide.

Hopefully that resolves it for you.

Thank, I appreciate your comms

1 Like

When I was self hosting on a shared serve with tarball installation I sometimes got this error. I always just re-downloaded and re-extracted the tarball and followed the update procedure (replacing all the files except site folder and running update.php) and this fixed it.

A note to always extract the tarball on the server and not on your local machine and upload the extracted files. Me not knowing the technical reason always found local extraction and uploading to be problematic but extracting on the serve usually worked. Sometimes I feel missing files during extraction caused this error.

1 Like