Page 1 of 1

SyntaxError during install

Posted: Wed May 12, 2021 2:03 pm
by netgroupnrlssc
[root@ng-log-4 nagioslogserver]# ./fullinstall
ERROR: unable to read system id.
Installing on RedHatEnterpriseServer 7.9

Nagios Log Server Installation
==============================
DATE: Wed May 12 14:49:44 EDT 2021

DISTRO INFO:
RedHatEnterpriseServer
7.9
x86_64

Running 'setup_local_syslog'...
setup_local_syslog step already completed - skipping
Running 'prereqs'...
epel-release RPM installed OK
Loaded plugins: enabled_repos_upload, package_upload, product-id, search-
: disabled-repos, subscription-manager
Package python2-pip-8.1.2-14.el7.noarch already installed and latest version
Package ipa-gothic-fonts-003.03-5.el7.noarch already installed and latest version
Package ipa-mincho-fonts-003.03-5.el7.noarch already installed and latest version
Package ipa-pgothic-fonts-003.03-5.el7.noarch already installed and latest version
Package ipa-pmincho-fonts-003.03-5.el7.noarch already installed and latest version
Package pyOpenSSL-0.13.1-4.el7.x86_64 already installed and latest version
Package python-2.7.5-90.el7.x86_64 already installed and latest version
Package ntp-4.2.6p5-29.el7_8.2.x86_64 already installed and latest version
Package byacc-1.9.20130304-3.el7.x86_64 already installed and latest version
Package cairo-devel-1.15.12-4.el7.x86_64 already installed and latest version
Package gcc-4.8.5-44.el7.x86_64 already installed and latest version
Package glib2-devel-2.56.1-8.el7.x86_64 already installed and latest version
Package glibc-2.17-324.el7_9.x86_64 already installed and latest version
Package 1:java-1.8.0-openjdk-1.8.0.292.b10-1.el7_9.x86_64 already installed and latest version
Package libxml2-devel-2.9.1-6.el7.5.x86_64 already installed and latest version
Package 1:make-3.82-24.el7.x86_64 already installed and latest version
Package 1:net-snmp-5.7.2-49.el7_9.1.x86_64 already installed and latest version
Package 1:net-snmp-utils-5.7.2-49.el7_9.1.x86_64 already installed and latest version
Package 1:openssl-1.0.2k-21.el7_9.x86_64 already installed and latest version
Package patch-2.7.1-12.el7_7.x86_64 already installed and latest version
Package pango-devel-1.42.4-4.el7_7.x86_64 already installed and latest version
Package perl-ExtUtils-MakeMaker-6.68-3.el7.noarch already installed and latest version
Package sendmail-8.14.7-6.el7.x86_64 already installed and latest version
Package httpd-2.4.6-97.el7_9.x86_64 already installed and latest version
Package php-5.4.16-48.el7.x86_64 already installed and latest version
Package php-cli-5.4.16-48.el7.x86_64 already installed and latest version
Package rc-1.7.4-1.el7.x86_64 already installed and latest version
Package wget-1.14-18.el7_6.1.x86_64 already installed and latest version
Package sudo-1.8.23-10.el7_9.1.x86_64 already installed and latest version
Package sysstat-10.1.5-19.el7.x86_64 already installed and latest version
Package unzip-6.0-21.el7.x86_64 already installed and latest version
Package zip-3.0-11.el7.x86_64 already installed and latest version
Package net-tools-2.0-0.25.20131004git.el7.x86_64 already installed and latest version
Package php-ldap-5.4.16-48.el7.x86_64 already installed and latest version
Package php-devel-5.4.16-48.el7.x86_64 already installed and latest version
Nothing to do
Uploading Enabled Repositories Report
Loaded plugins: product-id, subscription-manager
12 May 14:49:57 ntpdate[4501]: adjust time server 128.160.13.251 offset 0.019617 sec
Traceback (most recent call last):
File "/bin/pip", line 9, in <module>
load_entry_point('pip==21.1.1', 'console_scripts', 'pip')()
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 378, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2566, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2260, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/usr/lib/python2.7/site-packages/pip/_internal/cli/main.py", line 58
sys.stderr.write(f"ERROR: {exc}")
^
SyntaxError: invalid syntax

===================
INSTALLATION ERROR!
===================
Installation step failed - exiting.
Check for error messages in the install log (install.log).

If you require assistance in resolving the issue, please include install.log
in your communications with Nagios Enterprises technical support.

The step that failed was: 'prereqs'

Posted: Wed May 12, 2021 4:11 pm
by dchurch
What are the outputs for the following commands?

Code: Select all

pip --version
pip2 --version
pip3 --version
python --version
python2 --version
python3 --version

Re: SyntaxError during install

Posted: Thu May 13, 2021 7:20 am
by netgroupnrlssc

Code: Select all

[root@ng-log-4 ~]# pip --version
Traceback (most recent call last):
  File "/bin/pip", line 9, in <module>
    load_entry_point('pip==21.1.1', 'console_scripts', 'pip')()
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 378, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2566, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2260, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/lib/python2.7/site-packages/pip/_internal/cli/main.py", line 58
    sys.stderr.write(f"ERROR: {exc}")
                                   ^
SyntaxError: invalid syntax
[root@ng-log-4 ~]# pip2 --version
Traceback (most recent call last):
  File "/bin/pip2", line 9, in <module>
    load_entry_point('pip==21.1.1', 'console_scripts', 'pip2')()
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 378, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2566, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2260, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/lib/python2.7/site-packages/pip/_internal/cli/main.py", line 58
    sys.stderr.write(f"ERROR: {exc}")
                                   ^
SyntaxError: invalid syntax
[root@ng-log-4 ~]# pip3 --version
-bash: pip3: command not found
[root@ng-log-4 ~]# python --version
Python 2.7.5
[root@ng-log-4 ~]# python2 --version
Python 2.7.5
[root@ng-log-4 ~]# python3 --version
-bash: python3: command not found
Earlier I ran into an error about a typing module so I fixed it with:

Code: Select all

[root@ng-log-4 ~]# history | grep -i pip
  179  pip install --upgrade pip
  199  pip install typing

Posted: Thu May 13, 2021 11:08 am
by dchurch
"pip install --upgrade pip" will break pip on Cent 7.

Pip 8.1.2 is the last version of pip that's compatible with Python 2.x.

Fix your system by running this command as root:

Code: Select all

yum reinstall -y python2-pip

Re: SyntaxError during install

Posted: Thu May 13, 2021 11:17 am
by netgroupnrlssc
Thank you. Now I get a different error

Code: Select all

[root@ng-log-4 nagioslogserver]# ./fullinstall
ERROR: unable to read system id.
Installing on RedHatEnterpriseServer 7.9

Nagios Log Server Installation
==============================
DATE: Thu May 13 12:14:01 EDT 2021

DISTRO INFO:
RedHatEnterpriseServer
7.9
x86_64

Running 'setup_local_syslog'...
setup_local_syslog step already completed - skipping
Running 'prereqs'...
epel-release RPM installed OK
Loaded plugins: enabled_repos_upload, package_upload, product-id, search-
              : disabled-repos, subscription-manager
Package python2-pip-8.1.2-14.el7.noarch already installed and latest version
Package ipa-gothic-fonts-003.03-5.el7.noarch already installed and latest version
Package ipa-mincho-fonts-003.03-5.el7.noarch already installed and latest version
Package ipa-pgothic-fonts-003.03-5.el7.noarch already installed and latest version
Package ipa-pmincho-fonts-003.03-5.el7.noarch already installed and latest version
Package pyOpenSSL-0.13.1-4.el7.x86_64 already installed and latest version
Package python-2.7.5-90.el7.x86_64 already installed and latest version
Package ntp-4.2.6p5-29.el7_8.2.x86_64 already installed and latest version
Package byacc-1.9.20130304-3.el7.x86_64 already installed and latest version
Package cairo-devel-1.15.12-4.el7.x86_64 already installed and latest version
Package gcc-4.8.5-44.el7.x86_64 already installed and latest version
Package glib2-devel-2.56.1-8.el7.x86_64 already installed and latest version
Package glibc-2.17-324.el7_9.x86_64 already installed and latest version
Package 1:java-1.8.0-openjdk-1.8.0.292.b10-1.el7_9.x86_64 already installed and latest version
Package libxml2-devel-2.9.1-6.el7.5.x86_64 already installed and latest version
Package 1:make-3.82-24.el7.x86_64 already installed and latest version
Package 1:net-snmp-5.7.2-49.el7_9.1.x86_64 already installed and latest version
Package 1:net-snmp-utils-5.7.2-49.el7_9.1.x86_64 already installed and latest version
Package 1:openssl-1.0.2k-21.el7_9.x86_64 already installed and latest version
Package patch-2.7.1-12.el7_7.x86_64 already installed and latest version
Package pango-devel-1.42.4-4.el7_7.x86_64 already installed and latest version
Package perl-ExtUtils-MakeMaker-6.68-3.el7.noarch already installed and latest version
Package sendmail-8.14.7-6.el7.x86_64 already installed and latest version
Package httpd-2.4.6-97.el7_9.x86_64 already installed and latest version
Package php-5.4.16-48.el7.x86_64 already installed and latest version
Package php-cli-5.4.16-48.el7.x86_64 already installed and latest version
Package rc-1.7.4-1.el7.x86_64 already installed and latest version
Package wget-1.14-18.el7_6.1.x86_64 already installed and latest version
Package sudo-1.8.23-10.el7_9.1.x86_64 already installed and latest version
Package sysstat-10.1.5-19.el7.x86_64 already installed and latest version
Package unzip-6.0-21.el7.x86_64 already installed and latest version
Package zip-3.0-11.el7.x86_64 already installed and latest version
Package net-tools-2.0-0.25.20131004git.el7.x86_64 already installed and latest version
Package php-ldap-5.4.16-48.el7.x86_64 already installed and latest version
Package php-devel-5.4.16-48.el7.x86_64 already installed and latest version
Nothing to do
Uploading Enabled Repositories Report
Loaded plugins: product-id, subscription-manager
13 May 12:14:14 ntpdate[786]: adjust time server 128.160.13.251 offset -0.001138 sec
Collecting argparse
  Using cached https://files.pythonhosted.org/packages/f2/94/3af39d34be01a24a6e65433d19e107099374224905f1e0cc6bbe1fd22a2f/argparse-1.4.0-py2.py3-none-any.whl
Collecting elasticsearch-curator==3.4.0
  Using cached https://files.pythonhosted.org/packages/fc/a7/29d0bda164b6dc6ac730b3e8ce9b27e9aec6106f2589af83b5e5bedaf134/elasticsearch_curator-3.4.0-py2.py3-none-any.whl
Collecting elasticsearch<2.1.0,>=1.8.0 (from elasticsearch-curator==3.4.0)
  Using cached https://files.pythonhosted.org/packages/cf/18/1b7a51cbc1caf2b99a913449f354dba8179b0fe6dfddd08ab160ebe54e1f/elasticsearch-2.0.0-py2.py3-none-any.whl
Collecting click>=3.3 (from elasticsearch-curator==3.4.0)
  Using cached https://files.pythonhosted.org/packages/d5/99/286fd2fdfb501620a9341319ba47444040c7b3094d3b6c797d7281469bf8/click-8.0.0.tar.gz
    Complete output from command python setup.py egg_info:
    error in click setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-uLoPF5/click/

===================
INSTALLATION ERROR!
===================
Installation step failed - exiting.
Check for error messages in the install log (install.log).

If you require assistance in resolving the issue, please include install.log
in your communications with Nagios Enterprises technical support.

The step that failed was: 'prereqs'

జ్ఞ‌ా

Posted: Thu May 13, 2021 2:44 pm
by dchurch
1. Edit "fullinstall"
2. Around line 107, add this line:

Code: Select all

            # click 8.0.0 is incompatible with Python 2.x
            pipextra='click<8.0.0'
When the edit is made correctly, the full code block there should look like this:

Code: Select all

        # Add the epel repo before continuing
        add_yum_repo "epel"
        pip="python-pip"
        if [ "$dist" == "el7" ]; then
            pip="python2-pip"
            # click 8.0.0 is incompatible with Python 2.x
            pipextra='click<8.0.0'
        elif [ "$dist" == "el8" ]; then
            pip="python3-pip"
        else
            pipextra="urllib3==1.22"
        fi
I've also included this file as a patch. If you prefer you can apply the patch to the script using the following command:

Code: Select all

patch /tmp/nagioslogserver/fullinstall < 0001-Fix-compatibility-with-CentOS-7-RHEL-7-with-Python-2.patch
3. Re-run "./fullinstall"

Re: SyntaxError during install

Posted: Fri May 14, 2021 11:18 am
by netgroupnrlssc
That did it. Thanks

Posted: Fri May 14, 2021 1:06 pm
by dchurch
Glad to hear you resolved it! Locking thread.

If you have any additional issues, feel free to make a new thread.