Issues with Sugar 13.0 and PHP 8.2 in Vagrant

Anyone else having issues getting Sugar 13.0 to work in a Vagrant using PHP 8.2? I keep getting " (Elasticsearch Queue Scheduler) failed in CRON run, Undefined constant "Sugarcrm\Sugarcrm\Elasticsearch\Adapter\CURLOPT_USERAGENT"" from the cron jobs but I also see "Undefined constant" in the php error logs. I have gotten it to work using PHP 8.0 but not 8.2, which is the version Sugar says 13.0 is compatible with. I am currently using Vagrant "sugarcrm/php80es716" but I have upgraded ElasticSearch to 8.7.1 and MySQL to 8.0.33 but I have been unable to get 13.0 to work on Vagrant "sugarcrm/php82es84"

  • Hi ,

    Are you installing a fresh Sugar13 from our dev builds or is it a backup from your cloud?

    There's no need to upgrade your vagrant image as they have what's needed to run (see Development Platforms.).

    If you want PHP8.2, go with sugarcrm/php82es84.

    Please let me know which build you are using so I can try it on my end and if there's something to be done in the image, I'll fix and update it so you can use.

    SugarCRM | Principal Developer Advocate

  • This is a cloud backup. Also, Rafael, as I stated, I tried sugarcrm/php82es84. The reason for upgrading the images is for a true development environment, it needs to match up with the Live environment. I have a list of commands I have to run on Vagrant images to get them where they need to be for development and testing purposes. So far the images I have used have always been missing SSL and certain php mods that are required to match the live environment. Also, the images are too small to hold a live backup, so I have to also extend the storage for the vagrant image to work. Currently, I have been unable to get 13.0 to work with PHP 8.2.

  • Hi ,

    Interesting, could you share what you change/run, so I can try to incorporate that in the core images going forward?

    As for your statement "it needs to match up with the Live environment, not sure if I agree with it, as those images are supposed to match our Development Platforms for a particular release.

    For example, upgrading to ES 8.7.1 and/or MySQL 8.0.33, you are running on a non-supported platform, you can do that but at your own risk, we did not certify Sugar on those.

    If you find issues with the versions we release, let me know (as you are doing here) and I'll make sure those images get fixed and released.

    SugarCRM | Principal Developer Advocate

  • I will add my scripts to this reply to help you understand what is missing from images. 

    Yes, I might have went a version or two beyond what is certified, but that is besides the point when it comes to the issue I am having. If I am developing on more up to date image, I will run into issues for future updates and be able to address them before they can affect Live.

    We are getting off track here. So far, 13.0 is not working on sugarcrm/php82es84, which is the suggested vagrant image for 13.0.

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    #Install VirtualBox and Vagrant
    copy Vagrantfile <SUGAR_DIRECTORY>/Vagrantfile
    cd <SUGAR_DIRECTORY>
    vagrant plugin install vagrant-disksize
    vagrant plugin install vagrant-vbguest
    vagrant up
    wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo gpg --dearmor -o /usr/share/keyrings/elasticsearch-keyring.gpg
    echo "deb [signed-by=/usr/share/keyrings/elasticsearch-keyring.gpg] https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-7.x.list
    echo "deb [signed-by=/usr/share/keyrings/elasticsearch-keyring.gpg] https://artifacts.elastic.co/packages/8.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-8.x.list
    apt update
    #add a new partition /dev/sda2 to add the extra free space
    fdisk /dev/sda
    pvcreate /dev/sda2
    vgextend vagrant-vg /dev/sda2
    lvextend -l +100%FREE /dev/vagrant-vg/root
    resize2fs /dev/vagrant-vg/root
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Well it seems this is a major problem, since this has turned into the most viewed thread.

  • Hi ,

    yeah it is a problem and I'm fixing it, most of the ubuntu packages in that image weren't installed correctly back when I built it.

    I'm working on a new version, and will let you and all know, when I'm done.

    SugarCRM | Principal Developer Advocate

  • Hi ,

    I've just released a new version of  sugarcrm/php82es84  that contains the fixes required to install a Vanila instance of Sugar 13.0.

    To ensure you have gotten the latest available in the Vagrant Cloud, I recommend you remove your local copy (or force v1.1 to be downloaded in your Vagrantfile), to remove it, simply run vagrant box remove sugarcrm/php82es84.

    You should see something like this:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    sh-3.2$ vagrant up
    Bringing machine 'default' up with 'virtualbox' provider...
    ==> default: Box 'sugarcrm/php82es84' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
    ==> default: Loading metadata for box 'sugarcrm/php82es84'
    default: URL: https://vagrantcloud.com/sugarcrm/php82es84
    ==> default: Adding box 'sugarcrm/php82es84' (v1.1) for provider: virtualbox
    default: Downloading: https://vagrantcloud.com/sugarcrm/boxes/php82es84/versions/1.1/providers/virtualbox.box
    default: Calculating and comparing box checksum...
    ==> default: Successfully added box 'sugarcrm/php82es84' (v1.1) for 'virtualbox'!
    ==> default: Importing base box 'sugarcrm/php82es84'...
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    As you can see below, everything checks out and passed.

    SugarCRM | Principal Developer Advocate

  • I will try building a new local dev environment tomorrow to test.

  • I can confirm that the vagrant does work for Sugar 13.0. Although, the vagrant is still missing a few php packages (php-mysql php-zip php-xml php-bcmath) that are required for turning on scheduler. 

  • Hi ,

    This is odd, I did test (and execute) a few jobs myself without issues, could you please share any details you have for us? I don't see how that'd fail unless there are extra needs from your cloud backup.

    Here's a list of modules installed in the image:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    vagrant@vagrant:/vagrant$ php -m
    [PHP Modules]
    bcmath
    calendar
    Core
    ctype
    curl
    date
    dom
    exif
    FFI
    fileinfo
    filter
    ftp
    gd
    gettext
    gmp
    hash
    iconv
    imap
    json
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    SugarCRM | Principal Developer Advocate

1 2