Suitecrm 8 module access error

Hello, everyone,
I did a clean installation of Suite 8, starting from scratch, so no upgrades.
Many modules don’t work, for example if I go into contacts or accounts this message appears:

Error occurred while fetching metadata

and in the log:

Error: the file [modules/SavedSearch/metadata/editviewdefs.php] is missing. Cannot create as HTML file could not be found.

I also tried to import some custom modules created in Suitecrm 7.10.20, the import went well, if I go in Studio I see the installed packages, even in the menu they are present, but they are missing in the custom folder and the message described above appears anyway, in fact they were installed in the main folder and not in custom.
Same thing if I create a new module from Studio.

I noticed that the structure has changed a bit, now the modules are located in

suitecrm8\public\legacy\modules

and customizations in

suitecrm8\public\legacy\custom\modules

and the log in

suitecrm8\public\legacy

Does anyone know how to fix this? Thanks

Hi @fab,

Thanks for trying out SuiteCRM 8.

Does the following error occur right after installing SuiteCRM 8, without installing custom modules?

Error occurred while fetching metadata

Yes, exactly. I scanned the page and this is the error it displays in the network section:

ERROR Error: Uncaught (in promise): TypeError: e.viewDefinition is null
parseListViewMetadata@http://localhost/suitecrm8/public/dist/dist_core___ivy_ngcc___fesm2015_core_js-_f1391-es2015.19d51bb434f7a1ceddd8.js:23:12950...

I have also changed in the .env file

APP_ENV=prod

to

APP_ENV=qa

but nothing new happens

Hi @fab,

After changing to qa, could you check the following please?

  • open the browser devtools
  • try again
  • Check the network tab for a graphql with an error entry on the response
  • This error should have a stack trace. Could you send this please?

There are 3

graphql

calls, but none of them have errors

Hi @fab,

Thank you.

Is one of those calls to metadata? could you send me the response json please?

Should be this:

{"data":{"viewDefinition":{"id":"\/suitecrm8\/public\/api\/metadata\/view-definitions\/saved-search","_id":"saved-search","recordView":{"templateMeta":{"maxColumns":2,"useTabs":true,"tabDefs":{"LBL_DEFAULT":{"newTab":true,"panelDefault":"expanded"}}},"topWidget":{"refreshOn":"data-update"},"sidebarWidgets":[],"actions":[{"key":"create","labelKey":"LBL_NEW","params":{"expanded":true},"modes":["detail"],"acl":["edit"]},{"key":"edit","labelKey":"LBL_EDIT","params":{"expanded":true},"modes":["detail"],"acl":["edit"]},{"key":"save","labelKey":"LBL_SAVE_BUTTON_LABEL","asyncProcess":false,"params":{"expanded":true},"modes":["edit"],"acl":[]},{"key":"saveNew","labelKey":"LBL_SAVE_BUTTON_LABEL","params":{"expanded":true},"modes":["create"],"acl":["edit"]},{"key":"delete","labelKey":"LBL_DELETE","asyncProcess":false,"params":{"expanded":true,"displayConfirmation":true,"confirmationLabel":"NTC_DELETE_CONFIRMATION"},"modes":["detail","edit"],"acl":[]},{"key":"duplicate","labelKey":"LBL_DUPLICATE_BUTTON","asyncProcess":true,"params":null,"modes":["detail"],"acl":["export","edit"]}],"panels":[{"key":"lbl_default","rows":[{"cols":[{"name":"name","label":"LBL_NAME","displayParams":{"required":true},"fieldDefinition":{"name":"name","type":"varchar","vname":"LBL_NAME","len":150,"required":true},"type":"varchar"},{"name":"orderBy","label":"LBL_ORDER_BY_COLUMNS","fieldDefinition":{"name":"orderBy","type":"enum","displayType":"dropdown","vname":"LBL_ORDER_BY_COLUMNS","len":150,"source":"non-db","required":false},"type":"enum"},{"name":"sortOrder","label":"LBL_DIRECTION","fieldDefinition":{"name":"sortOrder","type":"enum","displayType":"radio","displayDirection":"row","options":"sort_order","vname":"LBL_DIRECTION","source":"non-db","required":false},"type":"enum"}]}]}],"summaryTemplates":{"create":"LBL_CREATE","edit":"LBL_SUMMARY_DEFAULT","detail":"LBL_SUMMARY_DEFAULT"},"vardefs":{"id":{"name":"id","vname":"LBL_NAME","type":"id","required":true,"reportable":false},"name":{"name":"name","type":"varchar","vname":"LBL_NAME","len":150,"required":false},"search_module":{"name":"search_module","type":"varchar","vname":"LBL_MODULE","len":150,"required":false},"orderBy":{"name":"orderBy","type":"enum","displayType":"dropdown","vname":"LBL_ORDER_BY_COLUMNS","len":150,"source":"non-db","required":false},"sortOrder":{"name":"sortOrder","type":"enum","displayType":"radio","displayDirection":"row","options":"sort_order","vname":"LBL_DIRECTION","source":"non-db","required":false},"deleted":{"name":"deleted","vname":"LBL_CREATED_BY","type":"bool","required":true,"reportable":false},"date_entered":{"name":"date_entered","vname":"LBL_DATE_ENTERED","type":"datetime","required":true},"date_modified":{"name":"date_modified","vname":"LBL_DATE_MODIFIED","type":"datetime","required":true},"assigned_user_id":{"name":"assigned_user_id","rname":"user_name","id_name":"assigned_user_id","vname":"LBL_ASSIGNED_TO","type":"assigned_user_name","table":"users","isnull":"false","dbType":"id","reportable":true,"massupdate":false,"required":false},"assigned_user_name":{"name":"assigned_user_name","vname":"LBL_ASSIGNED_TO_NAME","type":"varchar","reportable":false,"massupdate":false,"source":"non-db","table":"users","required":false},"contents":{"name":"contents","type":"text","vname":"LBL_DESCRIPTION","isnull":true,"required":false},"description":{"name":"description","type":"text","vname":"LBL_DESCRIPTION","isnull":true,"required":false},"assigned_user_link":{"name":"assigned_user_link","type":"link","relationship":"saved_search_assigned_user","vname":"LBL_ASSIGNED_TO_USER","link_type":"one","module":"Users","bean_name":"User","source":"non-db","required":false,"relationshipMetadata":{"side":"lhs","related_id":"","type":"one-to-many","parent_id":""}}}},"__typename":"ViewDefinition"}}}

Hi @fab,

Thank you. I’m looking into the json you’ve sent. By the way, was that the only metadata call, from the 3, there should be a second one. If there is could you send the the json for that one also please?

this is the first one:

{"data":{"createProcess":{"process":{"_id": "user-acl", "status": "success", "async":false, "type": "user-acl", "messages":null, "data":{"result":true},"__typename": "Process"}, "clientMutationId":null,"__typename": "createProcessPayload"}}}}

the second:

{"data":{"viewDefinition":null}}

Hi @fab,

Thank you! That makes more sense. The problem in this one.

{"data":{"viewDefinition":null}}

What does it have on the request payload? meaning what module is it for?

This is the content of the request:

{"operationName": "viewDefinition", "variables":{"id":"/api/metadata/view-definitions/accounts"}, "query": "query viewDefinition($id: ID!) {\n id\n _id\n listView\n search\n recordView\n subPanel\n massUpdate\n __typename\n }}

I tried to open the accounts module

Hi @fab,

Thanks yet again.

Some more questions to try and understand the problem

What stack are you using?

  • php version
  • apache version
  • os and version?

Could you try to re-set permissions please?

  • By the way, is user the same as the group? like www-data:www-data

This is the version of PHP and Apache:

Apache/2.4.48 (Win64) OpenSSL/1.1.1k PHP/7.4.21

on Windows 10 Home

Hi @fab,

Thank you.

My best guess at the moment is permissions. That suitecrm its not able to write to cache or something.

Another thing to check is:

  • logs/prod/prod.log
  • public/legacy/suitecrm.log
  • php error log

We don’t support windows at the moment. Though I know some people using it. And they said they had to set the permissions a bit differently.

prod.log:

request.INFO: Matched route "index". {"route":"index","route_parameters":{"_route":"index","_controller":"App\\Engine\\Controller\\IndexController::index"},"request_uri":"http://localhost/suitecrm8/public/","method":"GET"} []
security.DEBUG: Read existing security token from the session. {"key":"_security_main","token_class":"Symfony\\Component\\Security\\Guard\\Token\\PostAuthenticationGuardToken"} []
request.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\ConnectionException: "An exception occurred in driver: SQLSTATE[HY000] [2002] connection cannot be established. Persistent rejection of the target computer. " at C:\xampp\htdocs\suitecrm8\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\AbstractMySQLDriver.php line 112 {"exception":"[object] (Doctrine\\DBAL\\Exception\\ConnectionException(code: 0): An exception occurred in driver: SQLSTATE[HY000] [2002] connection cannot be established. Persistent rejection of the target computer.\r\n at C:\\xampp\\htdocs\\suitecrm8\\vendor\\doctrine\\dbal\\lib\\Doctrine\\DBAL\\Driver\\AbstractMySQLDriver.php:112, Doctrine\\DBAL\\Driver\\PDO\\Exception(code: 2002): SQLSTATE[HY000] [2002] connection cannot be established. Persistent rejection of the target computer.\r\n at C:\\xampp\\htdocs\\suitecrm8\\vendor\\doctrine\\dbal\\lib\\Doctrine\\DBAL\\Driver\\PDO\\Exception.php:18, PDOException(code: 2002): SQLSTATE[HY000] [2002] connection cannot be established. Persistent rejection of the target computer.\r\n at C:\\xampp\\htdocs\\suitecrm8\\vendor\\doctrine\\dbal\\lib\\Doctrine\\DBAL\\Driver\\PDOConnection.php:40)"} []

suitecrm.log:

Error: the file [modules/SavedSearch/metadata/editviewdefs.php] is missing. Cannot create as HTML file could not be found.

no php_error log file is generated

Hi all, I notice that in a new installation, if I disable English language from the options (after installed Italian one) I have the error with metadata.
Once I enable english language again, error disappear.

Hi @maxxx1,

Welcome to the community :wave: and thanks for trying out SuiteCRM 8.

Thanks for your feedback. Yes the same issue has been recently raised by another user.
There is a issue on github.

Please also consider having a look at the following thread:

Thanks so much. First solved!!

I would to know how to enable another language by default and not have the error issue.

In my case, I am looking to run SuiteCRM in Spanish and I am getting “Error Occurred While fetching Metadata” .

Please, do you have a workaround to start using SuiteCRM, we have not passed from testing and this issue is disappointing us a lot.