better error loging

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jamie
    Senior Member
    • Aug 2025
    • 273

    #1

    better error loging

    Just what am I meant to do with the below output, is it from a workflow, a flowchart, a workchart? if so, what one? Who even knows?,

    At least include enough information that i can track down the problem easily without making it a wild goose chase and wasting my time.

    Just what is the point of giving errors i can't track down? You might as well not display them if the purpose isn't to fix them


    [2026-03-19 13:00:05] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:05] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:05] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:05] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:05] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:05] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:05] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] WARNING: Workflow: Could not get related entity by path 'sentBy.teams'.
    [2026-03-19 13:00:06] WARNING: Workflow: Could not get related entity by path 'sentBy.teams'.
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:06] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:07] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:07] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:07] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:07] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:07] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:07] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:07] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:07] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:07] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:07] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:07] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:07] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:07] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:07] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:07] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:07] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:07] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:07] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:07] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:07] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:07] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:07] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:
    [2026-03-19 13:00:08] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:08] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:08] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:08] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:08] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:08] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:08] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:08] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:08] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:08] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:08] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:08] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:08] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:09] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:09] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:10] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:10] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:10] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:10] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:10] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:00:10] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:01:26] ERROR:
    [2026-03-19 13:01:26] ERROR:
    [2026-03-19 13:01:59] ERROR:
    [2026-03-19 13:01:59] ERROR:
    [2026-03-19 13:03:16] ERROR:
    [2026-03-19 13:03:16] ERROR:
    [2026-03-19 13:03:16] ERROR:
    [2026-03-19 13:03:16] ERROR:
    [2026-03-19 13:03:30] ERROR:
    [2026-03-19 13:03:30] ERROR:
    [2026-03-19 13:03:30] NOTICE: Formula function: array\at, index doesn't exist
    [2026-03-19 13:03:41] ERROR:
    [2026-03-19 13:03:41] ERROR:
    [2026-03-19 13:03:44] ERROR:
    [2026-03-19 13:03:44] ERROR:
    [2026-03-19 13:03:51] ERROR:
    [2026-03-19 13:03:51] ERROR:
    [2026-03-19 13:03:52] ERROR: No access.
    [2026-03-19 13:03:59] WARNING: Workflow: Could not get related entity by path 'sentBy.teams'.
    [2026-03-19 13:03:59] WARNING: Workflow: Could not get related entity by path 'sentBy.teams'.
    [2026-03-19 13:04:07] ERROR:
    [2026-03-19 13:04:07] ERROR:
    [2026-03-19 13:04:15] ERROR:
    [2026-03-19 13:04:15] ERROR:
    [2026-03-19 13:04:18] WARNING: Workflow: Could not get related entity by path 'sentBy.teams'.
    [2026-03-19 13:04:18] WARNING: Workflow: Could not get related entity by path 'sentBy.teams'.
    [2026-03-19 13:04:18] WARNING: E_WARNING: Undefined array key 6
    [2026-03-19 13:04:18] WARNING: E_WARNING: Undefined array key 6
  • yuri
    EspoCRM product developer
    • Mar 2014
    • 9765

    #2
    Most errors can be tracked down by enabling tracing in the log. It's how it's supposed to work.

    Some log messages are not traced, if there are some important, each one should be fixed separately. There's no single engine that we can fix so all log messages are traced.

    > Just what is the point of giving errors i can't track down?

    There's no need to write this in a feature request other than to add more toxic tone to it.

    Comment

    • jamie
      Senior Member
      • Aug 2025
      • 273

      #3
      It's meant to share my sense of frustration at seeing a massive amount of errors in my setup, but because of obscurity, doing anything about this is very difficult

      Well, maybe it's time to have all errors feed through a single log function so they can be better handled and traced. Many of them list the offending workflow ID, and that's all I need, but without any source of reference, I am probably going to have to write my own script just to handle the shortcomings of the output

      Comment

      • yuri
        EspoCRM product developer
        • Mar 2014
        • 9765

        #4
        The all go through the standard PSR logger. In case of exceptions, they can be traced. In case of notices (just message), they can't be easily traced. We can add some context, and sometime we do add, but often it's very hard to know the exact context at it occurs very deep. We try not to use notices and prefer errors now, it's usually a legacy code that can't be changed to prevent compatibility breaks.

        Comment

        • jamie
          Senior Member
          • Aug 2025
          • 273

          #5
          if you could just always display the workflow id that would be amazing

          Comment

          • yuri
            EspoCRM product developer
            • Mar 2014
            • 9765

            #6
            Yes, but understand the the formula function is not aware of the workflows feature neither any other potential future feature it will be called from. How it's suppose to work: when an error occurred in a formula function, it is bubbled up until it's caught by something above. I believe we do it for workflow and display the ID. Not sure if it's always the case, need to check.

            For notices it's impossible to display the workflow ID.


            For "Workflow: Could not get related entity by path", it's possible and we should fix it (unfortunately the fix is not trivial in this particular case). But it's really the case that is not a real error and could be even lowered to the INFO level.
            Last edited by yuri; 03-20-2026, 08:39 AM.

            Comment

            • jamie
              Senior Member
              • Aug 2025
              • 273

              #7
              sounds like a bit a problem with the underlying architecture, maybe its worth spending some time fixing that up

              so it will be possible to get the offending workflow for these?

              [2026-03-19 13:04:18] WARNING: Workflow: Could not get related entity by path 'sentBy.teams'.
              [2026-03-19 13:04:18] WARNING: E_WARNING: Undefined array key 6

              Comment

              • yuri
                EspoCRM product developer
                • Mar 2014
                • 9765

                #8
                It's not a problem with the architecture. It's normal that a caller does not know about internal details about called functions if there is no tight coupling between them. Formula does not know about Workflows existence and should not know.

                Warnings and notices are more a legacy of PHP and should not exist had the PHP been created today. They should be exceptions which are caught by the caller.

                > [2026-03-19 13:04:18] WARNING: Workflow: Could not get related entity by path 'sentBy.teams'.

                This one that we already have fixed, as it's the case where the context is known.

                > [2026-03-19 13:04:18] WARNING: E_WARNING: Undefined array key 6

                This one cannot be caught other than converting it to the error. PHP is likely to evolve to produce an error for this in future. Then it will be possible to catch.

                Or maybe this warning is our fault in a particular place in code that we need to fix.

                Comment


                • yuri
                  yuri commented
                  Editing a comment
                  I could not find what could produce "Undefined array key 6" in the code base. If anyone find out, please let me know or create a PR.
              • yuri
                EspoCRM product developer
                • Mar 2014
                • 9765

                #9
                You can add a global error handler that produces an error when warning happens. This way it should print the workflow ID in the log.

                Maybe we need to consider to add it but disable it by default, otherwise it will be a serios breacking change for many.

                Another possible solution, is to pass the context down to be used for log printing. But it would require a significant effort that I think is not justifiable as we are moving to producing errors instead of notices, hence it will be not needed in the future. And it won't solve PHP-level notices, only app-level.
                Last edited by yuri; 03-25-2026, 11:01 AM.

                Comment

                • yuri
                  EspoCRM product developer
                  • Mar 2014
                  • 9765

                  #10
                  Changed array\at notice to the error. https://github.com/espocrm/espocrm/c...51c338238e2baf. We will need do it in other places too.

                  Comment

                  • shalmaxb
                    Senior Member
                    • Mar 2015
                    • 1861

                    #11
                    This already helped me a lot: https://deepwiki.com/ You choose espoCRM as the repo ando now this AI tries to resolve any question by using the published repo content.

                    when I input only two lines of your error

                    [2026-03-19 13:00:06] WARNING: Workflow: Could not get related entity by path 'sentBy.teams'.
                    [2026-03-19 13:00:06] WARNING: Workflow: Could not get related entity by path 'sentBy.teams'.

                    Answer
                    ## Error Message Explained

                    This warning means that the Workflow system is trying to access the path `sentBy.teams` but cannot find or access this relationship. [1](#1-0) [2](#1-1)

                    ## Technical Details

                    ### What the Path Attempts
                    The path `sentBy.teams` attempts to navigate from an Email entity to the sending user (`sentBy`) and then to that user's teams:

                    1. **Email → sentBy**: The Email entity has a `sentBy` relationship to the `User` entity [2](#1-1)
                    2. **User → teams**: The system then tries to access the user's teams

                    ### Why It Fails
                    The problem is that the `teams` relationship is not accessible through this path in the workflow context. Although users can have teams, the relationship configuration is not suitable for traversal by the Workflow system. [3](#1-2)

                    ### Possible Solutions
                    1. **Use direct user access**: Instead of `sentBy.teams`, use `sentBy` and then access the user's teams
                    2. **Adjust workflow logic**: Check the workflow conditions and use alternative access paths
                    3. **Check metadata**: Ensure the relationship metadata is correctly configured

                    ## Notes

                    The warning appears twice, indicating the workflow attempt is repeated. This is a typical Workflow system warning that indicates relationship problems but does not represent a critical system failure. [1](#1-0)

                    Wiki pages you might want to explore:
                    - [Field Views (espocrm/espocrm)](/wiki/espocrm/espocrm#2.3.2)

                    ### Citations

                    **File:** application/Espo/Resources/metadata/entityDefs/Email.json (L708-711)
                    ```json
                    "sentBy": {
                    "type": "belongsTo",
                    "entity": "User"
                    },
                    ```

                    **File:** application/Espo/Resources/metadata/entityDefs/Team.json (L45-53)
                    ```json
                    "users": {
                    "type": "hasMany",
                    "entity": "User",
                    "foreign": "teams",
                    "columnAttributeMap": {
                    "role": "userRole"
                    },
                    "apiSpecDisabled": true
                    },
                    ```

                    Comment


                    • jamie
                      jamie commented
                      Editing a comment
                      Thanks, yeah i know what the error is i just want an easier way to find it as i have about 30 of them errors. This is a system I inherited from someone with great enthusiasm and dev op skill, but not a strong developer background
                  • jamie
                    Senior Member
                    • Aug 2025
                    • 273

                    #12
                    yuri it would be a great help to track all errors down easier I have inherited this system from someone with great enthusiasm and dev op skill, but not a strong developer background and i want to get it working very smoothly so we can track down some deeper bugs inside the system

                    Any idea what release some of the easier ones to implement will be in?

                    thanks

                    Comment


                    • yuri
                      yuri commented
                      Editing a comment
                      It will be improved in v9.4 release and also the next AP release.
                  • jamie
                    Senior Member
                    • Aug 2025
                    • 273

                    #13
                    sweet, thanks mate!

                    Comment

                    Working...