Ad Widget

Collapse

Problem upgrading zabbix-frontend-php 3.2.9

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • q2413667
    Junior Member
    • Oct 2017
    • 3

    #1

    Problem upgrading zabbix-frontend-php 3.2.9

    Hi, I was upgrading zabbix 3.2.8 to 3.2.9 on Debian 9, using official repo from here "https://www.zabbix.com/documentation/3.2/manual/installation/install_from_packages/repository_installation"

    All package has been upgrade correctly, except zabbix-frontend-php

    Code:
    apt-get install zabbix-frontend-php
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following NEW packages will be installed:
      zabbix-frontend-php
    0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
    Need to get 0 B/2,080 kB of archives.
    After this operation, 14.6 MB of additional disk space will be used.
    Selecting previously unselected package zabbix-frontend-php.
    (Reading database ... 31534 files and directories currently installed.)
    Preparing to unpack .../zabbix-frontend-php_1%3a3.2.9-1+stretch_all.deb ...
    Unpacking zabbix-frontend-php (1:3.2.9-1+stretch) ...
    Setting up zabbix-frontend-php (1:3.2.9-1+stretch) ...
    /var/lib/dpkg/info/zabbix-frontend-php.postinst: line 11: syntax error near unexpected token `then'
    dpkg: error processing package zabbix-frontend-php (--configure):
     subprocess installed post-installation script returned error exit status 2
    Errors were encountered while processing:
     zabbix-frontend-php
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    Code:
    ii  zabbix-agent                         1:3.2.9-1+stretch              amd64        Zabbix network monitoring solution - agent
    iF  zabbix-frontend-php                  1:3.2.9-1+stretch              all          Zabbix network monitoring solution - PHP front-end
    ii  zabbix-get                           1:3.2.9-1+stretch              amd64        Zabbix network monitoring solution - get
    ii  zabbix-release                       3.2-1+stretch                  all          Zabbix official repository configuration
    ii  zabbix-server-mysql                  1:3.2.9-1+stretch              amd64        Zabbix network monitoring solution - server (MySQL)
    This is the content of the file /var/lib/dpkg/info/zabbix-frontend-php.postinst

    Code:
    #!/bin/sh -e
    
    if [ "$1" = "configure" ]; then
    
        if [ -d /etc/zabbix/web ]; then
           chown www-data.root /etc/zabbix/web
           chmod 755 /etc/zabbix/web
        fi
    
        for file in /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf; do
            if [ -e $file ]; then
                update-alternatives --install /usr/share/zabbix/fonts/graphfont.ttf zabbix-frontend-font $file 10
                break
            fi
        done
    
        for file in /etc/alternatives/ttf-japanese-gothic.ttf /etc/alternatives/fonts-japanese-gothic.ttf; do
            if [ -e $file ]; then
                update-alternatives --install /usr/share/zabbix/fonts/graphfont.ttf zabbix-frontend-font $file 20
                break
            fi
        done
    
        if [ -d /etc/apache2/conf.d ] && [ ! -f /etc/apache2/conf.d/zabbix ] && [ ! -h /etc/apache2/conf.d/zabbix ]; then
            ln -s /etc/zabbix/apache.conf /etc/apache2/conf.d/zabbix
        elif [ -d /etc/apache2/conf-available ] && [ ! -f /etc/apache2/conf-available/zabbix.conf ] && [ ! -h /etc/apache2/conf-available/zabbix.conf ]; then
            ln -s /etc/zabbix/apache.conf /etc/apache2/conf-available/zabbix.conf
            /usr/sbin/a2enconf zabbix.conf
        fi
    
    fi
    
    # dh_installdeb will replace this with shell code automatically
    # generated by other debhelper scripts.
    
    
    
    exit 0
    Somebody has the same issue?
  • jvandenbroek
    Junior Member
    • Oct 2011
    • 15

    #2
    Same issue here and not sure how to fix it.. Tried to change the for loop, without succes. Should be an easy fix, but can't see what's wrong.

    Comment

    • q2413667
      Junior Member
      • Oct 2017
      • 3

      #3
      Just for info

      postint file zabbix-frontend-php_3.2.8-1+stretch_all.deb

      Code:
      #!/bin/sh -e
      
      if [ "$1" = "configure" ]; then
      
          if [ -d /etc/zabbix/web ]; then
             chown www-data.root /etc/zabbix/web
             chmod 755 /etc/zabbix/web
          fi
      
          if [ -e /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf ]; then
              update-alternatives --install /usr/share/zabbix/fonts/graphfont.ttf zabbix-frontend-font /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf 10 
          fi
      
          if [ -e /etc/alternatives/ttf-japanese-gothic.ttf ]; then
              update-alternatives --install /usr/share/zabbix/fonts/graphfont.ttf zabbix-frontend-font /etc/alternatives/ttf-japanese-gothic.ttf 20
          elif [ -e /etc/alternatives/fonts-japanese-gothic.ttf ]; then
              update-alternatives --install /usr/share/zabbix/fonts/graphfont.ttf zabbix-frontend-font /etc/alternatives/fonts-japanese-gothic.ttf 20
          fi
      
          if [ -d /etc/apache2/conf.d ] && [ ! -f /etc/apache2/conf.d/zabbix ] && [ ! -h /etc/apache2/conf.d/zabbix ]; then
              ln -s /etc/zabbix/apache.conf /etc/apache2/conf.d/zabbix
          elif [ -d /etc/apache2/conf-available ] && [ ! -f /etc/apache2/conf-available/zabbix.conf ] && [ ! -h /etc/apache2/conf-available/zabbix.conf ]; then
              ln -s /etc/zabbix/apache.conf /etc/apache2/conf-available/zabbix.conf
              /usr/sbin/a2enconf zabbix.conf
          fi
      
      fi
      
      # dh_installdeb will replace this with shell code automatically
      # generated by other debhelper scripts.
      
      
      
      exit 0
      postint file zabbix-frontend-php_3.2.9-1+stretch_all.deb

      Code:
      #!/bin/sh -e
      
      if [ "$1" = "configure" ]; then
      
          if [ -d /etc/zabbix/web ]; then
             chown www-data.root /etc/zabbix/web
             chmod 755 /etc/zabbix/web
          fi
      
          for file in /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf; do
              if [ -e $file ]; then
                  update-alternatives --install /usr/share/zabbix/fonts/graphfont.ttf zabbix-frontend-font $file 10
                  break
              fi
          done
      
          for file in /etc/alternatives/ttf-japanese-gothic.ttf /etc/alternatives/fonts-japanese-gothic.ttf; do
              if [ -e $file ]; then
                  update-alternatives --install /usr/share/zabbix/fonts/graphfont.ttf zabbix-frontend-font $file 20
                  break
              fi
          done
      
          if [ -d /etc/apache2/conf.d ] && [ ! -f /etc/apache2/conf.d/zabbix ] && [ ! -h /etc/apache2/conf.d/zabbix ]; then
              ln -s /etc/zabbix/apache.conf /etc/apache2/conf.d/zabbix
          elif [ -d /etc/apache2/conf-available ] && [ ! -f /etc/apache2/conf-available/zabbix.conf ] && [ ! -h /etc/apache2/conf-available/zabbix.conf ]; then
              ln -s /etc/zabbix/apache.conf /etc/apache2/conf-available/zabbix.conf
              /usr/sbin/a2enconf zabbix.conf
          fi
      
      fi
      
      # dh_installdeb will replace this with shell code automatically
      # generated by other debhelper scripts.
      
      
      
      exit 0

      Comment

      • q2413667
        Junior Member
        • Oct 2017
        • 3

        #4
        Same issue with the new update, maybe you have to try to install .deb before pushing on the repo

        ii zabbix-frontend-php 1:3.2.9-2+stretch all Zabbix network monitoring solution - PHP front-end

        Comment

        • joeaintexas
          Junior Member
          • Oct 2017
          • 4

          #5
          Same issue - Failed to upgrade to 3.2.9 on 16.04

          Just wanted to also confirm that on an Ubuntu 16.04 server the zabbix-frontend-php is not upgrading, same error as mentioned in this post:

          Code:
          apt-get upgrade
          Reading package lists... Done
          Building dependency tree
          Reading state information... Done
          Calculating upgrade... Done
          0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
          1 not fully installed or removed.
          After this operation, 0 B of additional disk space will be used.
          Do you want to continue? [Y/n] Y
          Setting up zabbix-frontend-php (1:3.2.9-1+xenial) ...
          /var/lib/dpkg/info/zabbix-frontend-php.postinst: 11: /var/lib/dpkg/info/zabbix-frontend-php.postinst: Syntax error: "then" unexpected (expecting "done")
          dpkg: error processing package zabbix-frontend-php (--configure):
           subprocess installed post-installation script returned error exit status 2
          Errors were encountered while processing:
           zabbix-frontend-php
          E: Sub-process /usr/bin/dpkg returned an error code (1)
          Unfortunately I'm not a bash wizard, but if I can sort it out will post a patch.

          Comment

          • doctorbal82
            Member
            • Oct 2016
            • 39

            #6
            Seeing same issue on Debian 8.9

            Seeing same error on our Zabbix Devel environment running on Debian v8.9.

            Code:
            $ apt-get upgrade
            Reading package lists... Done
            Building dependency tree
            Reading state information... Done
            Calculating upgrade... Done
            0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
            1 not fully installed or removed.
            After this operation, 0 B of additional disk space will be used.
            Do you want to continue? [Y/n] Y
            Setting up zabbix-frontend-php (1:3.2.9-2+jessie) ...
            /var/lib/dpkg/info/zabbix-frontend-php.postinst: 11: /var/lib/dpkg/info/zabbix-frontend-php.postinst: Syntax error: "then" unexpected (expecting "done")
            dpkg: error processing package zabbix-frontend-php (--configure):
             subprocess installed post-installation script returned error exit status 2
            Errors were encountered while processing:
             zabbix-frontend-php
            E: Sub-process /usr/bin/dpkg returned an error code (1)
            I compared previous scripts from 3.2.8 and 3.2.9 and can't see any difference.

            I'm not an expert in bash and don't see why it would spit out the error on then when scripts compare perfectly fine from a version that worked well on upgrade.

            Any information would be awesome on how to resolve before pushing to production instance.

            Comment

            • helland71
              Junior Member
              • Feb 2017
              • 1

              #7
              I was able to recover from this error by removing some garbage from 2 lines in the zabbix-frontend-php.postinst file.

              Comment

              • doctorbal82
                Member
                • Oct 2016
                • 39

                #8
                Zabbix Frontend Error

                Originally posted by helland71
                I was able to recover from this error by removing some garbage from 2 lines in the zabbix-frontend-php.postinst file.
                helland71, care to share what garbage you removed?

                Comment

                • joeaintexas
                  Junior Member
                  • Oct 2017
                  • 4

                  #9
                  Originally posted by helland71
                  I was able to recover from this error by removing some garbage from 2 lines in the zabbix-frontend-php.postinst file.
                  And those 2 lines are?

                  Comment

                  • joeaintexas
                    Junior Member
                    • Oct 2017
                    • 4

                    #10
                    All,

                    It looks like a patch version of the zabbix-frontend-php package was released:

                    ii zabbix-frontend-php 1:3.2.9-2+xenial

                    3.2.9-2 vs 3.2.9-1. I ran apt-get upgrade and it went through this time around.

                    I never did get to the bottom of what was wrong with the postinst script, but my server is now updated.

                    Yours,
                    Joe

                    Comment

                    • doctorbal82
                      Member
                      • Oct 2016
                      • 39

                      #11
                      Reran apt-get update/upgrade on Debian Jessie with still the same error.

                      Comment

                      Working...