B2C mode and two addresses

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tanya
    Senior Member
    • Jun 2014
    • 4308

    #16
    if you set it in custom and file is valid, you can not lose this functionality

    Comment

    • khopper
      Senior Member
      • Sep 2017
      • 329

      #17
      I just ran the upgrade from 5.0.5 to 5.1.1 and got "clearing cache errors" again.
      I had to remove the following customization from Opportunity.json (See attachments) just to get the upgrade to work.
      This customization seems to cause "cache clearing errors" everywhere in the system even when adding fields or adding values to enum fields.
      This customization should not do that right?

      "serviceaddress": {
      "type": "address",
      "view": "custom:views/opportunity/fields/service-address"
      },

      Error From Logs:

      [2018-03-18 01:36:40] Espo.ERROR: API [POST]:/:controller/action/:action, Params:Array ( [controller] => Admin [action] => runUpgrade ) , InputData: {"id":"5aadc29d04d58"} - Error while clearing cache [] []
      [2018-03-18 01:36:40] Espo.ERROR: Display Error: Error while clearing cache, Code: 500 URL: /espocrm/api/v1/Admin/action/runUpgrade [] []
      [2018-03-18 01:36:42] Espo.ERROR: Uncaught Exception TypeError: "Argument 1 passed to Espo\ORM\EntityManager::setMetadata() must be of the type array, integer given, called in /var/www/espocrm/application/Espo/ORM/EntityManager.php on line 74" at /var/www/espocrm/application/Espo/ORM/EntityManager.php line 184 {"exception":"[object] (TypeError(code: 0): Argument 1 passed to Espo\\ORM\\EntityManager::setMetadata() must be of the type array, integer given, called in /var/www/espocrm/application/Espo/ORM/EntityManager.php on line 74 at /var/www/espocrm/application/Espo/ORM/EntityManager.php:184)"} []
      [2018-03-18 01:36:42] Espo.ERROR: Uncaught Exception TypeError: "Argument 1 passed to Espo\ORM\EntityManager::setMetadata() must be of the type array, integer given, called in /var/www/espocrm/application/Espo/ORM/EntityManager.php on line 74" at /var/www/espocrm/application/Espo/ORM/EntityManager.php line 184 {"exception":"[object] (TypeError(code: 0): Argument 1 passed to Espo\\ORM\\EntityManager::setMetadata() must be of the type array, integer given, called in /var/www/espocrm/application/Espo/ORM/EntityManager.php on line 74 at /var/www/espocrm/application/Espo/ORM/EntityManager.php:184)"} []
      [2018-03-18 01:36:42] Espo.ERROR: Uncaught Exception TypeError: "Argument 1 passed to Espo\ORM\EntityManager::setMetadata() must be of the type array, integer given, called in /var/www/espocrm/application/Espo/ORM/EntityManager.php on line 74" at /var/www/espocrm/application/Espo/ORM/EntityManager.php line 184 {"exception":"[object] (TypeError(code: 0): Argument 1 passed to Espo\\ORM\\EntityManager::setMetadata() must be of the type array, integer given, called in /var/www/espocrm/application/Espo/ORM/EntityManager.php on line 74 at /var/www/espocrm/application/Espo/ORM/EntityManager.php:184)"} []
      [2018-03-18 01:36:54] Espo.WARNING: E_WARNING: unlink(data/cache/templates/report-sending-body-grid-2-en_US.php): Permission denied {"code":2,"message":"unlink(data/cache/templates/report-sending-body-grid-2-en_US.php): Permission denied","file":"/var/www/espocrm/application/Espo/Core/Utils/File/Manager.php","line":587,"context":{"dirPath":"data/cache/templates","removeWithDir":true,"fileList":["report-sending-body-grid-2-en_US.php","report-sending-body-list-en_US.php","report-sending-subject-grid-2-en_US.php","report-sending-subject-list-en_US.php"],"result":true,"file":"report-sending-body-grid-2-en_US.php","fullPath":"data/cache/templates/report-sending-body-grid-2-en_US.php"}} []
      [2018-03-18 01:36:54] Espo.WARNING: E_WARNING: unlink(data/cache/templates/report-sending-body-list-en_US.php): Permission denied {"code":2,"message":"unlink(data/cache/templates/report-sending-body-list-en_US.php): Permission denied","file":"/var/www/espocrm/application/Espo/Core/Utils/File/Manager.php","line":587,"context":{"dirPath":"data/cache/templates","removeWithDir":true,"fileList":["report-sending-body-grid-2-en_US.php","report-sending-body-list-en_US.php","report-sending-subject-grid-2-en_US.php","report-sending-subject-list-en_US.php"],"result":0,"file":"report-sending-body-list-en_US.php","fullPath":"data/cache/templates/report-sending-body-list-en_US.php"}} []
      [2018-03-18 01:36:54] Espo.WARNING: E_WARNING: unlink(data/cache/templates/report-sending-subject-grid-2-en_US.php): Permission denied {"code":2,"message":"unlink(data/cache/templates/report-sending-subject-grid-2-en_US.php): Permission denied","file":"/var/www/espocrm/application/Espo/Core/Utils/File/Manager.php","line":587,"context":{"dirPath":"data/cache/templates","removeWithDir":true,"fileList":["report-sending-body-grid-2-en_US.php","report-sending-body-list-en_US.php","report-sending-subject-grid-2-en_US.php","report-sending-subject-list-en_US.php"],"result":0,"file":"report-sending-subject-grid-2-en_US.php","fullPath":"data/cache/templates/report-sending-subject-grid-2-en_US.php"}} []
      [2018-03-18 01:36:54] Espo.WARNING: E_WARNING: unlink(data/cache/templates/report-sending-subject-list-en_US.php): Permission denied {"code":2,"message":"unlink(data/cache/templates/report-sending-subject-list-en_US.php): Permission denied","file":"/var/www/espocrm/application/Espo/Core/Utils/File/Manager.php","line":587,"context":{"dirPath":"data/cache/templates","removeWithDir":true,"fileList":["report-sending-body-grid-2-en_US.php","report-sending-body-list-en_US.php","report-sending-subject-grid-2-en_US.php","report-sending-subject-list-en_US.php"],"result":0,"file":"report-sending-subject-list-en_US.php","fullPath":"data/cache/templates/report-sending-subject-list-en_US.php"}} []
      [2018-03-18 01:36:54] Espo.ERROR: API [POST]:/Admin/clearCache, Params:Array ( ) , InputData: - Error while clearing cache [] []
      [2018-03-18 01:36:54] Espo.ERROR: Display Error: Error while clearing cache, Code: 500 URL: /espocrm/api/v1/Admin/clearCache [] []
      [2018-03-18 01:39:15] Espo.ERROR: Uncaught Exception TypeError: "Argument 1 passed to Espo\ORM\EntityManager::setMetadata() must be of the type array, integer given, called in /var/www/espocrm/application/Espo/ORM/EntityManager.php on line 74" at /var/www/espocrm/application/Espo/ORM/EntityManager.php line 184 {"exception":"[object] (TypeError(code: 0): Argument 1 passed to Espo\\ORM\\EntityManager::setMetadata() must be of the type array, integer given, called in /var/www/espocrm/application/Espo/ORM/EntityManager.php on line 74 at /var/www/espocrm/application/Espo/ORM/EntityManager.php:184)"} []
      [2018-03-18 01:39:15] Espo.WARNING: E_WARNING: Invalid argument supplied for foreach() {"code":2,"message":"Invalid argument supplied for foreach()","file":"/var/www/espocrm/application/Espo/Core/ORM/Repositories/RDB.php","line":129,"context":{"params":[],"entityType":"AuthToken","metadata":"[object] (Espo\\Core\\Utils\\Metadata: {})","defs":1}} []
      [2018-03-18 01:39:15] Espo.ERROR: Uncaught Exception TypeError: "Argument 1 passed to Espo\ORM\DB\Mapper::select() must be an instance of Espo\ORM\IEntity, null given, called in /var/www/espocrm/application/Espo/ORM/Repositories/RDB.php on line 201" at /var/www/espocrm/application/Espo/ORM/DB/Mapper.php line 103 {"exception":"[object] (TypeError(code: 0): Argument 1 passed to Espo\\ORM\\DB\\Mapper::select() must be an instance of Espo\\ORM\\IEntity, null given, called in /var/www/espocrm/application/Espo/ORM/Repositories/RDB.php on line 201 at /var/www/espocrm/application/Espo/ORM/DB/Mapper.php:103)"} []
      Attached Files
      Last edited by khopper; 03-18-2018, 02:23 AM.

      Comment

      • tanya
        Senior Member
        • Jun 2014
        • 4308

        #18
        Hello.
        At first set correct permission to data folder and rebuild EspoCRM

        Comment


        • khopper
          khopper commented
          Editing a comment
          I already confirmed the permissions. I ran this command as well before hand: sudo chown -R www-data:www-data /var/www
      • tanya
        Senior Member
        • Jun 2014
        • 4308

        #19
        And what is in the log after you set permission and run Rebuild?

        Comment

        • khopper
          Senior Member
          • Sep 2017
          • 329

          #20
          It's sporadic and it let me rebuild, however I was able to get this for you.
          The logs below (attached) in conjunction with the screen shot (attached). As long as the permissions are proper i should not be getting the clearing cache error right?
          I kept running across the clearing cache error after almost immediately applying them and even after. Obviously the log date time is UTC while my system time is ETC.
          Attached Files

          Comment

          • tanya
            Senior Member
            • Jun 2014
            • 4308

            #21

            check access as well.
            Also check defaultPermissions in data/config.php
            Also, according to your log somewhere you call some Entity you not have (check your customizations)

            Yes, log is in UTC as well

            Comment

            • khopper
              Senior Member
              • Sep 2017
              • 329

              #22
              I confirmed the permissions, I even adjusted the crontab to run under user "www-data"
              I don't see where in the logs it mentions an Entity I not have. No new Entities have been created.
              The below log was a simple change - adding values to an ENUM field. I did a rebuild before attempting just fine.

              [2018-03-22 14:54:01] Espo.DEBUG: WorkflowManager: Start workflow [afterRecordSaved] for Entity [Opportunity, 5ab3c38904ffb7116]. [] []
              [2018-03-22 14:54:01] Espo.DEBUG: WorkflowManager: Start workflow rule [59f9dbda4c81ca9cf]. [] []
              [2018-03-22 14:54:01] Espo.DEBUG: WorkflowManager: Condition result [] for workflow rule [59f9dbda4c81ca9cf]. [] []
              [2018-03-22 14:54:01] Espo.DEBUG: WorkflowManager: End workflow rule [59f9dbda4c81ca9cf]. [] []
              [2018-03-22 14:54:01] Espo.DEBUG: WorkflowManager: End workflow [afterRecordSaved] for Entity [Opportunity, 5ab3c38904ffb7116]. [] []
              [2018-03-22 14:54:08] Espo.WARNING: E_WARNING: Invalid argument supplied for foreach() {"code":2,"message":"Invalid argument supplied for foreach()","file":"/var/www/espocrm/application/Espo/Core/ORM/Repositories/RDB.php","line":129,"context":{"params":[],"entityType":"AuthToken","metadata":"[object] (Espo\\Core\\Utils\\Metadata: {})","defs":1}} []
              [2018-03-22 14:54:08] Espo.WARNING: E_WARNING: Invalid argument supplied for foreach() {"code":2,"message":"Invalid argument supplied for foreach()","file":"/var/www/espocrm/application/Espo/Core/ORM/Repositories/RDB.php","line":129,"context":{"params":[],"entityType":"AuthToken","metadata":"[object] (Espo\\Core\\Utils\\Metadata: {})","defs":1}} []
              [2018-03-22 14:54:08] Espo.ERROR: Uncaught Exception TypeError: "Argument 1 passed to Espo\ORM\DB\Mapper::select() must be an instance of Espo\ORM\IEntity, null given, called in /var/www/espocrm/application/Espo/ORM/Repositories/RDB.php on line 201" at /var/www/espocrm/application/Espo/ORM/DB/Mapper.php line 103 {"exception":"[object] (TypeError(code: 0): Argument 1 passed to Espo\\ORM\\DB\\Mapper::select() must be an instance of Espo\\ORM\\IEntity, null given, called in /var/www/espocrm/application/Espo/ORM/Repositories/RDB.php on line 201 at /var/www/espocrm/application/Espo/ORM/DB/Mapper.php:103)"} []
              [2018-03-22 14:54:08] Espo.WARNING: E_WARNING: Invalid argument supplied for foreach() {"code":2,"message":"Invalid argument supplied for foreach()","file":"/var/www/espocrm/application/Espo/Core/ORM/Repositories/RDB.php","line":129,"context":{"params":[],"entityType":"AuthToken","metadata":"[object] (Espo\\Core\\Utils\\Metadata: {})","defs":1}} []
              [2018-03-22 14:54:08] Espo.WARNING: E_WARNING: Invalid argument supplied for foreach() {"code":2,"message":"Invalid argument supplied for foreach()","file":"/var/www/espocrm/application/Espo/Core/ORM/Repositories/RDB.php","line":129,"context":{"params":[],"entityType":"AuthToken","metadata":"[object] (Espo\\Core\\Utils\\Metadata: {})","defs":1}} []
              [2018-03-22 14:54:08] Espo.ERROR: Uncaught Exception TypeError: "Argument 1 passed to Espo\ORM\DB\Mapper::select() must be an instance of Espo\ORM\IEntity, null given, called in /var/www/espocrm/application/Espo/ORM/Repositories/RDB.php on line 201" at /var/www/espocrm/application/Espo/ORM/DB/Mapper.php line 103 {"exception":"[object] (TypeError(code: 0): Argument 1 passed to Espo\\ORM\\DB\\Mapper::select() must be an instance of Espo\\ORM\\IEntity, null given, called in /var/www/espocrm/application/Espo/ORM/Repositories/RDB.php on line 201 at /var/www/espocrm/application/Espo/ORM/DB/Mapper.php:103)"} []
              [2018-03-22 14:54:08] Espo.ERROR: Uncaught Exception TypeError: "Argument 1 passed to Espo\ORM\DB\Mapper::select() must be an instance of Espo\ORM\IEntity, null given, called in /var/www/espocrm/application/Espo/ORM/Repositories/RDB.php on line 201" at /var/www/espocrm/application/Espo/ORM/DB/Mapper.php line 103 {"exception":"[object] (TypeError(code: 0): Argument 1 passed to Espo\\ORM\\DB\\Mapper::select() must be an instance of Espo\\ORM\\IEntity, null given, called in /var/www/espocrm/application/Espo/ORM/Repositories/RDB.php on line 201 at /var/www/espocrm/application/Espo/ORM/DB/Mapper.php:103)"} []
              [2018-03-22 14:54:08] Espo.ERROR: Uncaught Exception TypeError: "Argument 1 passed to Espo\ORM\DB\Mapper::select() must be an instance of Espo\ORM\IEntity, null given, called in /var/www/espocrm/application/Espo/ORM/Repositories/RDB.php on line 201" at /var/www/espocrm/application/Espo/ORM/DB/Mapper.php line 103 {"exception":"[object] (TypeError(code: 0): Argument 1 passed to Espo\\ORM\\DB\\Mapper::select() must be an instance of Espo\\ORM\\IEntity, null given, called in /var/www/espocrm/application/Espo/ORM/Repositories/RDB.php on line 201 at /var/www/espocrm/application/Espo/ORM/DB/Mapper.php:103)"} []
              [2018-03-22 14:55:27] Espo.DEBUG: Schema\Converter - Start: building schema [] []
              [2018-03-22 14:55:27] Espo.DEBUG: DBAL: Table [entity_team] exists. [] []
              [2018-03-22 14:55:27] Espo.DEBUG: Schema\Converter - End: building schema [] []

              [2018-03-22 14:58:40] Espo.WARNING: E_WARNING: rmdir(data/cache/application): Directory not empty {"code":2,"message":"rmdir(data/cache/application): Directory not empty","file":"/var/www/espocrm/application/Espo/Core/Utils/File/Manager.php","line":529,"context":{"dirPaths":["data/cache/application"],"result":true,"dirPath":"data/cache/application"}} []
              [2018-03-22 14:58:40] Espo.ERROR: API [PATCH]:/Admin/fieldManager/:scope/:name, Params:Array ( [scope] => Account [name] => orderstatusi ) , InputData: {"name":"orderstatusi","type":"enum","required":fa lse,"options":["","N/A","Add more options","Rescheduled","Scheduled","Cancelled - Dead"],"isSorted":false,"audited":false,"readOnly":false ,"tooltip":false,"isCustom":true,"dynamicLogicVisi ble":null,"dynamicLogicRequired":null,"dynamicLogi cReadOnly":null,"dynamicLogicOptions":null,"transl atedOptions":{"":"","N/A":"N/A","Add more options":"Add more options","Rescheduled":"Rescheduled","Scheduled":" Scheduled","Cancelled - Dead":"Cancelled - Dead"},"default":""} - Error while clearing cache [] []
              [2018-03-22 14:58:40] Espo.ERROR: Display Error: Error while clearing cache, Code: 500 URL: /espocrm/api/v1/Admin/fieldManager/Account/orderstatusi [] []
              [2018-03-22 14:58:51] Espo.DEBUG: Schema\Converter - Start: building schema [] []
              [2018-03-22 14:58:51] Espo.DEBUG: Rebuild Database for entities: [Account] with dependent entities: [Account, EmailAddress, PhoneNumber, QuoteItem, Quote, Team, InboundEmail, Email, EmailAccount, EmailFolder, User, Attachment, Report, ReportCategory, TargetList, Lead, GoogleContactsPair, VoipMessage, Document, DocumentFolder, Contact, Task, CampaignLogRecord, EmailQueueItem, MassEmail, Campaign, CampaignTrackingUrl, Opportunity, OpportunityItem, Product, ProductCategory, ProductBrand, Call, GoogleCalendar, Meeting, GoogleCalendarUser, GoogleCalendarRecurrentEvent, EmailTemplate, Case, KnowledgeBaseArticle, KnowledgeBaseCategory, Portal, Note, PortalRole, Preferences, Role, EmailFilter, ShippingProvider, Tax] [] []
              [2018-03-22 14:58:52] Espo.DEBUG: DBAL: Table [entity_team] exists. [] []
              [2018-03-22 14:58:52] Espo.DEBUG: Schema\Converter - End: building schema [] []

              Comment

              • tanya
                Senior Member
                • Jun 2014
                • 4308

                #23
                could you share with me in PM your custom folder (if your customization is upgrade-safe only)? and what is your version

                Comment


                • khopper
                  khopper commented
                  Editing a comment
                  Sent via PM
              • tanya
                Senior Member
                • Jun 2014
                • 4308

                #24
                if you remove data/cache/application manually, is everything works good?

                Comment

                • khopper
                  Senior Member
                  • Sep 2017
                  • 329

                  #25
                  I have tried that many times in the past and it never really worked.

                  However since the last update 5.1.2 and the Bug fix: - Field Manager: Enum field problem.
                  It appears to be doing much better.

                  Comment

                  • khopper
                    Senior Member
                    • Sep 2017
                    • 329

                    #26
                    Any idea what this error means? See attached image
                    The copy function works though (I am setting a new instance)
                    Attached Files

                    Comment

                    • Maximus
                      Senior Member
                      • Nov 2018
                      • 2731

                      #27
                      Hi,
                      It is the warning. What EspoCRM version do you use?
                      could you provide file content from /client/custom/src/views/opportunity/fields/serviceAddress.js ?

                      Comment

                      Working...