• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    API doesn't work in 1.5.9 dev. Error in route.class.php

    Scheduled Pinned Locked Moved
    FOG Problems
    4
    10
    993
    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.
    • A
      abulhol
      last edited by

      We have upgraded a Ubuntu 18 server that was running 1.5.7 to Ubuntu 22.04 and FOG 1.5.9 dev branch (required because of PHP version check).

      The UI works, but any call to the API fails, the Apache error log shows this:

      Got error 'PHP message: PHP Fatal error:  Uncaught Error: Unknown named parameter $method in /var/www/fog/lib/router/route.class.php:351\nStack trace:\n#0 /var/www/fog/lib/router/route.class.php(231): Route::runMatches()\n#1 /var/www/fog/api/index.php(23): Route->__construct()\n#2 {main}\n  thrown in /var/www/fog/lib/router/route.class.php on line 351'
      

      Is this easy to fix?
      Otherwise, do you already have a timeline for a new FOG release that works on Ubuntu 22?

      Wayne WorkmanW 1 Reply Last reply Reply Quote 0
      • Wayne WorkmanW
        Wayne Workman @abulhol
        last edited by

        @abulhol Upgrading the OS that FOG runs on has mixed results. Sometimes it works, but usually does not. Generally it’s not advised to upgrade the OS to a new major version due to this. It’s usually advised to migrate your FOG server to a new home that has the new OS. There’s a guide for this, and you should still be able to do this even though your old FOG server is broke. https://wiki.fogproject.org/wiki/index.php?title=Migrate_FOG

        Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!
        Daily Clean Installation Results:
        https://fogtesting.fogproject.us/
        FOG Reporting:
        https://fog-external-reporting-results.fogproject.us/

        N 1 Reply Last reply Reply Quote 0
        • N
          Nono @Wayne Workman
          last edited by

          @wayne-workman Hi, thanks for the tip.
          In case we’re not in the position to migrate to a new server. What are you suggesting ?
          A) Doing all the backup (for the migration), then uninstalling/removing FOG, then upgrade the OS to reinstall fog after then upgrade ?
          or
          B) Upgrade FOG to the latest version, then upgrade the OS ?

          I can understand that a “proper” migration is always better, but that wouldn’t be far from removing all, then re-install properly, right ?

          Wayne WorkmanW 1 Reply Last reply Reply Quote 0
          • Wayne WorkmanW
            Wayne Workman @Nono
            last edited by

            @nono I’m not suggesting either of the options you listed, I suggest to migrate to a new box.

            Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!
            Daily Clean Installation Results:
            https://fogtesting.fogproject.us/
            FOG Reporting:
            https://fog-external-reporting-results.fogproject.us/

            A 1 Reply Last reply Reply Quote 0
            • A
              abulhol @Wayne Workman
              last edited by

              @wayne-workman Actually the migration seemed to have worked very well overall, given that we used the dev branch.
              The web UI works fine, it’s only the API that is returning errors.
              So to me it looks more like a PHP problem not related to our instance specifically.
              We will likely wait for your next release that officially supports Ubuntu 22, but we would very much appreciate if you could take a look at the API issue.

              A 1 Reply Last reply Reply Quote 0
              • A
                abulhol @abulhol
                last edited by

                @wayne-workman I have looked at your daily tests, it looks like they only confirm that the installer runs successfully.
                Do you have automated tests for the API? Please let me know when you have had a look at this.

                Wayne WorkmanW 1 Reply Last reply Reply Quote 0
                • Wayne WorkmanW
                  Wayne Workman @abulhol
                  last edited by

                  @abulhol said in API doesn't work in 1.5.9 dev. Error in route.class.php:

                  Do you have automated tests for the API?

                  I do not. But, if someone created some I would be happy to add them to the daily tests.

                  Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!
                  Daily Clean Installation Results:
                  https://fogtesting.fogproject.us/
                  FOG Reporting:
                  https://fog-external-reporting-results.fogproject.us/

                  A 1 Reply Last reply Reply Quote 0
                  • A
                    abulhol @Wayne Workman
                    last edited by

                    @wayne-workman I don’t have enough time to work on creatingmore tests, but I had a look at the PHP issue myself.

                    It is because of a breaking change in PHP 8:
                    https://php.watch/versions/8.0/named-parameters#named-params-call_user_func_array

                    It comes into play when call_user_func_array is used.

                    I’ll try to fix this myself as suggested in the link and create a PR on Github.

                    A 1 Reply Last reply Reply Quote 0
                    • A
                      abulhol @abulhol
                      last edited by

                      PR created in dev-branch

                      1 Reply Last reply Reply Quote 1
                      • S
                        Sebastian Roth Moderator
                        last edited by Sebastian Roth

                        @abulhol Thanks for looking into the error and fixing the issue via the github PR. Merge is done.

                        Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                        Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

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

                        151

                        Online

                        12.0k

                        Users

                        17.3k

                        Topics

                        155.2k

                        Posts
                        Copyright © 2012-2024 FOG Project