(Solved)Error trying to update

Hello there! I’ve noticied that today after seeing the update available I clicked on it and i got the following error:

        Traceback (most recent call last):

File “/opt/rockstor/src/rockstor/storageadmin/views/command.py”, line 193, in post
return Response(update_check(subscription=subo))
File “/opt/rockstor/src/rockstor/system/pkg_mgmt.py”, line 164, in update_check
o, e, rc = run_command([YUM, ‘changelog’, date, pkg])
File “/opt/rockstor/src/rockstor/system/osi.py”, line 121, in run_command
raise CommandException(cmd, out, err, rc)
CommandException: Error running a command. cmd = /usr/bin/yum changelog 2017-Dec-29 rockstor. rc = 1. stdout = [‘Loaded plugins: changelog, fastestmirror’, ‘’]. stderr = [‘Traceback (most recent call last):’, ’ File “/usr/bin/yum”, line 29, in ‘, ’ yummain.user_main(sys.argv[1:], exit_code=True)’, ’ File “/usr/share/yum-cli/yummain.py”, line 370, in user_main’, ’ errcode = main(args)’, ’ File “/usr/share/yum-cli/yummain.py”, line 179, in main’, ’ result, resultmsgs = base.doCommands()’, ’ File “/usr/share/yum-cli/cli.py”, line 583, in doCommands’, ’ return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd, self.extcmds)’, ’ File “/usr/lib/yum-plugins/changelog.py”, line 215, in doCommand’, " if self._since_dto == dateutil_parser.parse(‘garbage’, fuzzy=True):", ’ File “/usr/lib/python2.7/site-packages/dateutil/parser.py”, line 1182, in parse’, ’ return DEFAULTPARSER.parse(timestr, **kwargs)’, ’ File “/usr/lib/python2.7/site-packages/dateutil/parser.py”, line 562, in parse’, ’ raise ValueError(“String does not contain a date.”)’, ‘ValueError: String does not contain a date.’, ‘’]

After getting this, now i can’t see the current version that I’m using right now and i can’t update anymore.

Maybe I have a wrong version of the date parser?

@DarkYamik Hello again.

Yes this one is strange as we use yum’s changelog plugin and in one report the required date parse was not installed, yet it’s supposed to be a dependency of the changelog plugin. This was reported over in the following forum thread:

But your report is a little different:

As you say the parser does seem to be installed but is not recognising the “2017-Dec-29” string as containing a date from the CommandException:

cmd = /usr/bin/yum changelog 2017-Dec-29 rockstor

with the “raise ValueError(“String does not contain a date.”)” return.

And that command works without error here.

/usr/bin/yum changelog 2017-Dec-29 rockstor
Loaded plugins: changelog, fastestmirror
Rockstor-Stable                                                                                                      | 2.9 kB  00:00:00     
base                                                                                                                 | 3.6 kB  00:00:00     
epel/x86_64/metalink                                                                                                 |  25 kB  00:00:00     
epel                                                                                                                 | 4.7 kB  00:00:00     
extras                                                                                                               | 3.4 kB  00:00:00     
rockstor                                                                                                             | 2.9 kB  00:00:00     
updates                                                                                                              | 3.4 kB  00:00:00     
(1/3): epel/x86_64/group_gz                                                                                          | 266 kB  00:00:00     
(2/3): epel/x86_64/updateinfo                                                                                        | 866 kB  00:00:01     
(3/3): epel/x86_64/primary_db                                                                                        | 6.2 MB  00:00:03     
Loading mirror speeds from cached hostfile
 * base: centos.serverspace.co.uk
 * epel: mirrors.coreix.net
 * extras: mirrors.coreix.net
 * updates: mirrors.coreix.net
changelog stats. 1 pkg, 1 source pkg, 0 changelogs

What is the result of the following command:

yum info python-dateutil

I get:

Installed Packages
Name        : python-dateutil
Arch        : noarch
Version     : 1.5
Release     : 7.el7
Size        : 343 k
Repo        : installed
From repo   : anaconda
Summary     : Powerful extensions to the standard datetime module
URL         : http://labix.org/python-dateutil
Licence     : Python
Description : The dateutil module provides powerful extensions to the standard
            : datetime module available in Python 2.3+.

No worries on the update as you can always update via the command line by running the following as root:

yum update rockstor

and to view the installed and available versions you can do:

yum info rockstor

obviously a work around but just while we get to the bottom of this.

Have you tried doing a general update via the UI, ie all packages bar the rockstor one. It’s available via a flashing icon to the left of the word “Linux” in the top right of the UI (only shows up if any are available).

non-rockstor-updates

It could be we are hitting a bug in an older version of the “python-dateutil” but seems unlikely. But the string clearly does contain a date.

My initial suspicion in your case is that we have a regional issue as we execute all commands as if they were en_US ie:

But I would still have expected dateutil to have worked.

Thanks for the report and let us know how you get on with those commands.

Thank you for the fast reply!

I tried the command on the command line and I get the same error

[root@yaminas ~]# /usr/bin/yum changelog 2017-Dec-29 rockstor
Loaded plugins: changelog, fastestmirror
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in <module>
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 370, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 179, in main
    result, resultmsgs = base.doCommands()
  File "/usr/share/yum-cli/cli.py", line 583, in doCommands
    return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd, self.extcmds)
  File "/usr/lib/yum-plugins/changelog.py", line 215, in doCommand
    if self._since_dto == dateutil_parser.parse('garbage', fuzzy=True):
  File "/usr/lib/python2.7/site-packages/dateutil/parser.py", line 1182, in parse
    return DEFAULTPARSER.parse(timestr, **kwargs)
  File "/usr/lib/python2.7/site-packages/dateutil/parser.py", line 562, in parse
    raise ValueError("String does not contain a date.")
ValueError: String does not contain a date.

The output from the command yum info python-dateutil is the following

[root@yaminas ~]# yum info python-dateutil
Loaded plugins: changelog, fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.airenetworks.es
 * epel: mirror.airenetworks.es
 * extras: mirror.airenetworks.es
 * updates: mirror.airenetworks.es
Installed Packages
Name        : python-dateutil
Arch        : noarch
Version     : 1.5
Release     : 7.el7
Size        : 343 k
Repo        : installed
From repo   : anaconda
Summary     : Powerful extensions to the standard datetime module
URL         : http://labix.org/python-dateutil
License     : Python
Description : The dateutil module provides powerful extensions to the standard
            : datetime module available in Python 2.3+.

The outpout is exactly the same as yours

I tried to update via CLI and UI, but from the UI I get the error we are talking about and i can’t even see the version i’m using.
RockstorVersion

Rockstor version is 3.9.2 by the way

[root@yaminas ~]# yum info rockstor
Loaded plugins: changelog, fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.airenetworks.es
 * epel: mirror.airenetworks.es
 * extras: mirror.airenetworks.es
 * updates: mirror.airenetworks.es
Installed Packages
Name        : rockstor
Arch        : x86_64
Version     : 3.9.2
Release     : 9
Size        : 77 M
Repo        : installed
From repo   : Rockstor-Stable
Summary     : RockStor -- Store Smartly
License     : GPL
Description : RockStor -- Store Smartly

I thought the same, but I’m using en_US locals to avoid problems regarding them

This is the outpuu from the LANG variable

[root@yaminas ~]# echo $LANG
en_US.UTF-8

Thank you for your help!

Okay I found what seems to be the problem. On the file that shows the error
(nano /usr/lib/yum-plugins/changelog.py), there is the following line 215


                if self._since_dto == dateutil_parser.parse('garbage', fuzzy=True):
                    # 'since' was a package name, not a date
                    extcmds.insert(0, since)

If i change the ‘garbage’ variable to 2017-Dec-29 as it follows


                if self._since_dto == dateutil_parser.parse('2017-Dec-29', fuzzy=True):
                    # 'since' was a package name, not a date
                    extcmds.insert(0, since)

If I do this, everything is working fine and updates are working correctly. For what i can see, the argument provided plain text is not a date so thats why it shows the error

Okay, I found it i needed to change the variable and everything works fine right now

                if self._since_dto == dateutil_parser.parse(since, fuzzy=True):
                    # 'since' was a package name, not a date
                    extcmds.insert(0, since)

I don’t know why it was like that though, maybe is a generalized error?

1 Like

@DarkYamik Nice debugging there.

and from the following:

rpm -qf /usr/lib/yum-plugins/changelog.py
yum-plugin-changelog-1.1.31-42.el7.noarch

we have that file belonging to the package:

yum-plugin-changelog

with:

yum info yum-plugin-changelog
Loaded plugins: changelog, fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.clustered.net
 * epel: mirror.vorboss.net
 * extras: mirror.vorboss.net
 * updates: mozart.ee.ic.ac.uk
Installed Packages
Name        : yum-plugin-changelog
Arch        : noarch
Version     : 1.1.31
Release     : 42.el7
Size        : 40 k
Repo        : installed
From repo   : base
Summary     : Yum plugin for viewing package changelogs before/after updating
URL         : http://yum.baseurl.org/download/yum-utils/
Licence     : GPLv2+
Description : This plugin adds a command line option to allow viewing package changelog
            : deltas before or after updating packages.

But I have the exact same line in my version and it isn’t throwing the error here:

                if self._since_dto == dateutil_parser.parse('garbage', fuzzy=True):
                    # 'since' was a package name, not a date
                    extcmds.insert(0, since)
/usr/bin/yum changelog 2017-Dec-29 rockstor
Loaded plugins: changelog, fastestmirror
rockstor                                                                                                       | 2.9 kB  00:00:00     
Loading mirror speeds from cached hostfile
 * base: mirror.mhd.uk.as44574.net
 * epel: mirror.vorboss.net
 * extras: mirror.mhd.uk.as44574.net
 * updates: mozart.ee.ic.ac.uk
changelog stats. 1 pkg, 1 source pkg, 0 changelogs

Do you have the exact same version of “yum-plugin-changelog”?

Well done researching this, but I don’t think we are quite at the root of it just yet.

My LANG:

echo $LANG
en_GB.UTF-8

But as stated previously it also doesn’t fail when run via run_command’s faked US either.

Yes, I think for some reason your setup is failing through to that error which is not what I’m seeing here.

And just to cover this one I have tried the problem command without error on the exact same version of rockstor as yours ie:

yum info rockstor
Loaded plugins: changelog, fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.coreix.net
 * epel: mirrors.coreix.net
 * extras: mirror.clustered.net
 * updates: mirrors.coreix.net
Installed Packages
Name        : rockstor
Arch        : x86_64
Version     : 3.9.2
Release     : 9
Size        : 77 M
Repo        : installed
From repo   : Rockstor-Stable
Summary     : RockStor -- Store Smartly
Licence     : GPL
Description : RockStor -- Store Smartly

just in case installed / available versions are some how triggering something:

rockstor-version-displayed

So still a bit of a puzzle.