Navigation

    Kopano
    • Register
    • Login
    • Search
    • Categories
    • Get Official Kopano Support
    • Recent
    Statement regarding the closure of the Kopano community forum and the end of the community edition

    Caldav Sync error - Unsupported operand types: string * int

    Synchronising (mobile) devices via Z-Push
    3
    15
    1977
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Realshadow
      Realshadow @Realshadow last edited by

      After a little bit of tinkering and changing I am down to the error message:

      04/04/2021 18:33:06 [ 1672] [WARN] [USER] Not possible to determine class of request. Request did not contain class
       and apparently there is an issue with the HierarchyCache.
      

      Does anyone know what to do about it? I will do a little more investigation but for now that is where I am stuck. I also changed the backend from “combined” to “caldav” only to figure out that module and try each at a time. Somehow this time it is by far more complicated then when I set the sync up with v2.5.2. Weird.

      realshadow

      1 Reply Last reply Reply Quote 0
      • Realshadow
        Realshadow last edited by

        Anyone any idea about that unsupported operand error? I checked my config several times, changed it from

        define('CALDAV_PATH', '/nextcloud/remote.php/dav/calendars/%u/');
        

        to

        define('CALDAV_PATH', '/nextcloud/remote.php/dav/calendars/%u/Personal');
        

        and tried about any combination you can imagine. The calendar just won’t work. I checked the path for nextcloud, made sure it uses the right path but I cannot get that to work. Does anyone have any idea why an error like that (unsupported operand) be triggered in the caldav module?
        I even checked the backend combined several times to make sure that I defined the right folders in that backend.

        Please, I really want to get that server back up an running.

        Thank you.

        realshadow

        Manfred 1 Reply Last reply Reply Quote 0
        • Manfred
          Manfred Kopano @Realshadow last edited by

          Hi @realshadow,

          are you using PHP 8? What is the OS of the server? We didn’t check the if Z-Push code is compatible with it yet.

          A quick solution would be to wrap possible string values with int. E.g.

          int($interval->format("%h"))
          

          Manfred

          Realshadow 2 Replies Last reply Reply Quote 0
          • Realshadow
            Realshadow @Manfred last edited by Realshadow

            @manfred Yes I am using PHP8. I was thinking that that might be the issue but when I use the installer (DEBIAN10) php8 is being installed automatically so I thought I’ll work with it. Let me implement what you suggested and I’ll get back to you in a few minutes.
            I assume I have to put that piece of code into the CaldDav.php backend file?

            Thanks.

            Manfred 1 Reply Last reply Reply Quote 0
            • Manfred
              Manfred Kopano @Realshadow last edited by

              Hi @realshadow,

              @realshadow said in Caldav Sync error - Unsupported operand types: string * int:

              @manfred Yes I am using PHP8. I was thinking that that might be the issue but when I use the installer (DEBIAN10) php8 is being installed automatically so I thought I’ll work with it. Let me implement what you suggested and I’ll get back to you in a few minutes.

              What installer are you using? According to the debian wiki the default PHP version for debian 10 is 7.3: https://wiki.debian.org/DebianBuster#Packages_.26_versions. It would surprise me a lot if debian would update a major PHP version in their minor release.

              I assume I have to put that piece of code into the CaldDav.php backend file?

              Yes, that example was specifically for the caldav.php, but there are probably more places in code which need adjustments.

              Z-Push doesn’t support PHP 8 yet, so even if you’ll get that to work, there’s no guarantee it will be stable enough to use it productively. I suggest you to go with PHP 7.

              Manfred

              Realshadow 1 Reply Last reply Reply Quote 0
              • Realshadow
                Realshadow @Manfred last edited by

                @manfred
                I replaced the line 847 in the caldav.php from

                $message->reminder = $interval->format("%i") + $interval->format("%h") * 60 + $interval->format("%a") * 60 * 24;
                

                with

                $message->reminder = int($interval->format("%i")) + int($interval->format("%h")) * 60 + int($interval->format("%a")) * 60 * 24;
                

                that is giving me the error message:

                05/04/2021 13:16:10 [ 6014] [FATAL] [USER] Fatal error: /usr/share/z-push/backend/caldav/caldav.php:848 - Uncaught
                Error: Call to undefined function int() in /usr/share/z-push/backend/caldav/caldav.php:847
                

                With your earlier indication that PHP8 could not be compatible with the latest z-push I will uninstall all php8.0 modules that were installed on that server. I will then install 7.4 and see if I can make that work. That will probably take me the better part of today and tomorrow. I might just setup a new VM all together.
                Let me get back to you tomorrow about what I find. Thanks so much for your help. I really appreciate your help and the effort you put into z-push. I love this tool and can’t wait to have it back up an running again.

                Manfred 1 Reply Last reply Reply Quote 0
                • Realshadow
                  Realshadow @Manfred last edited by

                  @manfred That is perfect. Thanks for that feedback. I will install 7.4 again. Debian by default uses 7.3. That might be the one I will go with. Thanks again. I’ll get back to tomorrow as that will take me some time to change and update.

                  1 Reply Last reply Reply Quote 0
                  • Manfred
                    Manfred Kopano @Realshadow last edited by

                    Hi @realshadow,

                    sorry, the function is intval, not int, but to go with PHP 7 is a better option for now anyway.

                    Manfred

                    Realshadow 3 Replies Last reply Reply Quote 0
                    • Realshadow
                      Realshadow @Manfred last edited by

                      @manfred Good morning,

                      I refreshed my server and removed any remnants of php8. I then reinstalled and reconfigured z-push. By default php7.3 was installed. I managed to get the synchronization running partially again. I am still getting error messages that a “non numeric value was encountered” more precisely

                      06/04/2021 08:58:57 [27730] [WARN] [USER] /usr/share/z-push/backend/caldav/caldav.php:847 A non-numeric value encountered (2)
                      

                      and my calendars for birthdays is not being picked up and the main calendar which was listed as “personal” before does show up as default in Outlook. I am also getting weird behaviour that the inbox is synchronized but as soon as I do anything the inbox suddenly is empty and does not resync until I reopen Outlook. The error message I get at that point is

                      06/04/2021 09:31:43 [27754] [ INFO] [USER] StatusException: Folderid not found in cache - code: 12 - file: /usr/sha
                      re/z-push/backend/imap/imap.php:1013
                      

                      I will now try to recreate my Outlook profile and resync again. I hope that provides me with a better idea what is happening.

                      realshadow

                      1 Reply Last reply Reply Quote 0
                      • Realshadow
                        Realshadow @Manfred last edited by

                        @manfred
                        All right after deleting and recreating my outlook profile everything is working again. Error message is still there but as far as I can tell the sync is updating everything into my outlook. I will do some more testing but
                        THANK YOU
                        for that simple but effective information. I am so excited to be back up and running.

                        realshadow

                        1 Reply Last reply Reply Quote 0
                        • Realshadow
                          Realshadow @Manfred last edited by

                          @manfred I have a question for you. That is somewhat related but I need to understand something. If, by changing the code for the caldav.php file, the error message would disappear, why is that not part of the code base already? I cannot be the first one to encounter this issue, tons of people work with Outlook and seeing what issues are created within php8 should that not be done? Even with the current php7.3 you already get an error message but the sync still works. Why are not all of the commands enclosed by intval? Seems like an easy fix to me. Would that create another issue on another backend side?

                          Thanks so much for your feedback.

                          realshadow

                          Manfred 1 Reply Last reply Reply Quote 0
                          • Manfred
                            Manfred Kopano @Realshadow last edited by

                            Hi @Realshadow,

                            @realshadow said in Caldav Sync error - Unsupported operand types: string * int:

                            @manfred I have a question for you. That is somewhat related but I need to understand something. If, by changing the code for the caldav.php file, the error message would disappear, why is that not part of the code base already?

                            The caldav backend is a community contribution and we (Sebastian and I) are not very actively involved in its development. I don’t use this backend daily, so before your post I wasn’t even aware that this issue existed. I suppose the regular backend contributors also aren’t aware of it, that’s why it hasn’t been fixed yet.

                            @realshadow said in Caldav Sync error - Unsupported operand types: string * int:

                            I cannot be the first one to encounter this issue, tons of people work with Outlook and seeing what issues are created within php8 should that not be done? Even with the current php7.3 you already get an error message but the sync still works.

                            Maybe you’re not the first to encounter the issue, but you’re the first I’m hearing about it. It would help if you would also open an issue at Z-Push Jira https://jira.z-hub.io/browse/ZP, so that someone would pick it up.

                            @realshadow said in Caldav Sync error - Unsupported operand types: string * int:

                            Why are not all of the commands enclosed by intval? Seems like an easy fix to me. Would that create another issue on another backend side?

                            Thanks so much for your feedback.

                            realshadow

                            I don’t think it would created other issues, but someone has to fix it and test it and as far as I saw it, PHP 8 is not yet a part of major linux distributions, so that’s also a possibility why nobody has fixed it yet.

                            Manfred

                            Realshadow 1 Reply Last reply Reply Quote 0
                            • Realshadow
                              Realshadow @Manfred last edited by

                              @manfred Thank you very much for your response. I appreciate it. I will open a JIRA ticket to ensure visibility of that issue.

                              1 Reply Last reply Reply Quote 0
                              • bob4os
                                bob4os last edited by

                                There is a branch ZP-1571 which contains a fix already.
                                (Commit: https://stash.z-hub.io/projects/ZP/repos/z-push/commits/5df5573b4f6bda362ee80d94e07d7cbefbc2a1eb )

                                The usage of $interval->format("%a") in line 847 on a DateInterval is wrong, because this will never return a valid result.

                                It should be:
                                $message->reminder = $interval->format("%i") + $interval->format("%h") * 60 + $interval->format("%d") * 60 * 24;

                                1 Reply Last reply Reply Quote 0
                                • First post
                                  Last post