Discussion:
unwanted crontab message
(too old to reply)
Marcus Park
2024-09-13 21:50:01 UTC
Permalink
Hi list,

When I run 'crontab -e' the screen shows some errors like,

$ crontab -e
Error detected while processing /usr/share/vim/vim82/filetype.vim:
line 10:
E319: Sorry, the command is not available in this version: let
did_load_filetypes = 1
line 13:
E319: Sorry, the command is not available in this version: let
s:cpo_save = &cpo
line 47:
E319: Sorry, the command is not available in this version: func!
s:StarSetf(ft)
line 51:
E319: Sorry, the command is not available in this version: endfunc
line 2440:
E319: Sorry, the command is not available in this version: func!
TestFiletypeFuncs(testlist)
line 2441:
E319: Sorry, the command is not available in this version: let output = ''
line 2442:
E319: Sorry, the command is not available in this version: for f in
a:testlist
... (and many other lines)

how to fix up it?

Thanks.
Greg Wooledge
2024-09-13 22:00:01 UTC
Permalink
Post by Marcus Park
Hi list,
When I run 'crontab -e' the screen shows some errors like,
$ crontab -e
E319: Sorry, the command is not available in this version: let
did_load_filetypes = 1
What version of Debian is this?

What version of the vim package (or any similarly named package) are
you running?

Did you do anything *noteworthy* with this system, such as attempting
an upgrade from one version of Debian to another, having it fail, and
leaving it half done?

For the record, Debian 12 has vim 9.0.x and a /usr/share/vim/vim90/
directory. According to <https://packages.debian.org/vim>... oh,
that web page is not responding for me. Sorry, I can't check what
version(s) of Debian might have had vim 8.2.

Anyway, it sounds like you have vim 8.2 config files, but you're running
an *older* version of vim which can't read those configs. Either that,
or the /usr/share/vim/vim82/filetype.vim file is corrupted. If it's
a corrupted file, you could purge and reinstall the vim package(s).
Michael Kjörling
2024-09-14 08:50:01 UTC
Permalink
Post by Greg Wooledge
For the record, Debian 12 has vim 9.0.x and a /usr/share/vim/vim90/
directory. According to <https://packages.debian.org/vim>... oh,
that web page is not responding for me. Sorry, I can't check what
version(s) of Debian might have had vim 8.2.
Bullseye / 11 had vim 8.2. (Specifically, the current package version
is 2:8.2.2434-3+deb11u1 <https://packages.debian.org/bullseye/vim>.)

Buster had 8.1, Bookworm is at 9.0 as you say, and Trixie and Sid are
both currently on the 9.1 branch.
--
Michael Kjörling 🔗 https://michael.kjorling.se
“Remember when, on the Internet, nobody cared that you were a dog?”
Andy Smith
2024-09-13 22:00:01 UTC
Permalink
Hi,
Post by Marcus Park
When I run 'crontab -e' the screen shows some errors like,
$ crontab -e
I'm pretty sure that these errors will be coming from the editor
binary that is set in your VISUAL or EDITOR environment variables,
or failing thatm whatever /usr/bin/editor points at.

man crontab

The -e option is used to edit the current crontab using the
editor specified by the VISUAL or EDITOR environ‐ ment
variables. After you exit from the editor, the modified crontab
will be installed automatically. If neither of the
environment variables is defined, then the default editor
/usr/bin/editor is used.
Post by Marcus Park
how to fix up it?
Set EDITOR or VISUAL to an editor that works.

export EDITOR=nano

or whatever you prefer.

As to why whatever it is set as right now is doing that, first work
out where it is getting the setting from, so echo $EDITOR and echo
$VISUAL. If neither of those are set then ls -la /usr/bin/editor.

I'll guess that you have vim-tiny or some other very minimal vi
clone installed but still somehow have vim-runtime installed and
it's trying to use that while not being able to parse it.

So either use a different editor or fix that editor or remove
vim-runtime, I suppose.

Thanks,
Andy
--
https://bitfolk.com/ -- No-nonsense VPS hosting
Marcus Park
2024-09-13 22:20:01 UTC
Permalink
Post by Andy Smith
As to why whatever it is set as right now is doing that, first work
out where it is getting the setting from, so echo $EDITOR and echo
$VISUAL. If neither of those are set then ls -la /usr/bin/editor.
Thanks Andy.

either $EDITOR or $VISUAL in my system is empty.

And /usr/bin/editor points to nano.

Then I run this command,

$ sudo update-alternatives --config editor
There are 4 choices for the alternative editor (providing /usr/bin/editor).

Selection Path Priority Status
------------------------------------------------------------
* 0 /bin/nano 40 auto mode
1 /bin/ed -100 manual mode
2 /bin/nano 40 manual mode
3 /usr/bin/vim.basic 30 manual mode
4 /usr/bin/vim.tiny 15 manual mode

Press <enter> to keep the current choice[*], or type selection number: 3
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/editor
(editor) in manual mode



to choose vim.basic as default editor.

In my system both vim.basic and vim are the same stuff,

$ vim --version
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Aug 27 2024 05:34:22)
Included patches: 1-16, 647, 17-579, 1969, 580-647, 678, 648-1848, 4975,
5016, 5023, 5072, 2068, 1849-1854, 1857, 1855-1857, 1331, 1858,
1858-1859, 1873, 1860-1969, 1992, 1970-1992, 2010, 1993-2068, 2106,
2069-2106, 2108, 2107-2109, 2109-3995, 4563, 4646, 4774, 4895, 4899,
4901, 4919, 213, 1840, 1846-1847, 2110-2112, 2121
...


$ vim.basic --version
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Aug 27 2024 05:34:22)
Included patches: 1-16, 647, 17-579, 1969, 580-647, 678, 648-1848, 4975,
5016, 5023, 5072, 2068, 1849-1854, 1857, 1855-1857, 1331, 1858,
1858-1859, 1873, 1860-1969, 1992, 1970-1992, 2010, 1993-2068, 2106,
2069-2106, 2108, 2107-2109, 2109-3995, 4563, 4646, 4774, 4895, 4899,
4901, 4919, 213, 1840, 1846-1847, 2110-2112, 2121
...


Then I logged out and re-login the system, run 'crontab -e', the error
still shows. Maybe I got bad luck today. :(

Regards.
Will Mengarini
2024-09-13 22:50:01 UTC
Permalink
You are getting Vim error messages from a version of Vim that does
not support scripting (probably vim.tiny). That version is probably
installed on your system ALONG WITH a version that does support
scripting, but cron does not have the scripting version of Vim on PATH.
(Typically, your $HOME & root PATHs are more elaborate than the one to
which cron defaults.) The solution is to set PATH in your crontab.
Post by Marcus Park
Post by Andy Smith
As to why whatever it is set as right now is doing that, first work
out where it is getting the setting from, so echo $EDITOR and echo
$VISUAL. If neither of those are set then ls -la /usr/bin/editor.
Thanks Andy.
either $EDITOR or $VISUAL in my system is empty.
And /usr/bin/editor points to nano.
Then I run this command,
$ sudo update-alternatives --config editor
There are 4 choices for the alternative editor (providing /usr/bin/editor).
Selection Path Priority Status
------------------------------------------------------------
* 0 /bin/nano 40 auto mode
1 /bin/ed -100 manual mode
2 /bin/nano 40 manual mode
3 /usr/bin/vim.basic 30 manual mode
4 /usr/bin/vim.tiny 15 manual mode
Press <enter> to keep the current choice[*], or type selection number: 3
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/editor
(editor) in manual mode
to choose vim.basic as default editor.
In my system both vim.basic and vim are the same stuff,
$ vim --version
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Aug 27 2024 05:34:22)
Included patches: 1-16, 647, 17-579, 1969, 580-647, 678, 648-1848, 4975,
5016, 5023, 5072, 2068, 1849-1854, 1857, 1855-1857, 1331, 1858, 1858-1859,
1873, 1860-1969, 1992, 1970-1992, 2010, 1993-2068, 2106, 2069-2106, 2108,
2107-2109, 2109-3995, 4563, 4646, 4774, 4895, 4899, 4901, 4919, 213, 1840,
1846-1847, 2110-2112, 2121
...
$ vim.basic --version
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Aug 27 2024 05:34:22)
Included patches: 1-16, 647, 17-579, 1969, 580-647, 678, 648-1848, 4975,
5016, 5023, 5072, 2068, 1849-1854, 1857, 1855-1857, 1331, 1858, 1858-1859,
1873, 1860-1969, 1992, 1970-1992, 2010, 1993-2068, 2106, 2069-2106, 2108,
2107-2109, 2109-3995, 4563, 4646, 4774, 4895, 4899, 4901, 4919, 213, 1840,
1846-1847, 2110-2112, 2121
...
Then I logged out and re-login the system, run 'crontab -e', the error still
shows. Maybe I got bad luck today. :(
Regards.
Will Mengarini
2024-09-13 23:00:01 UTC
Permalink
Or ... disambiguate which Vim crontab -e is using, so it's not vim.tiny.
Post by Will Mengarini
You are getting Vim error messages from a version of Vim that does
not support scripting (probably vim.tiny). That version is probably
installed on your system ALONG WITH a version that does support
scripting, but cron does not have the scripting version of Vim on PATH.
(Typically, your $HOME & root PATHs are more elaborate than the one to
which cron defaults.) The solution is to set PATH in your crontab.
Post by Marcus Park
Post by Andy Smith
As to why whatever it is set as right now is doing that, first work
out where it is getting the setting from, so echo $EDITOR and echo
$VISUAL. If neither of those are set then ls -la /usr/bin/editor.
Thanks Andy.
either $EDITOR or $VISUAL in my system is empty.
And /usr/bin/editor points to nano.
Then I run this command,
$ sudo update-alternatives --config editor
There are 4 choices for the alternative editor (providing /usr/bin/editor).
Selection Path Priority Status
------------------------------------------------------------
* 0 /bin/nano 40 auto mode
1 /bin/ed -100 manual mode
2 /bin/nano 40 manual mode
3 /usr/bin/vim.basic 30 manual mode
4 /usr/bin/vim.tiny 15 manual mode
Press <enter> to keep the current choice[*], or type selection number: 3
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/editor
(editor) in manual mode
to choose vim.basic as default editor.
In my system both vim.basic and vim are the same stuff,
$ vim --version
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Aug 27 2024 05:34:22)
Included patches: 1-16, 647, 17-579, 1969, 580-647, 678, 648-1848, 4975,
5016, 5023, 5072, 2068, 1849-1854, 1857, 1855-1857, 1331, 1858, 1858-1859,
1873, 1860-1969, 1992, 1970-1992, 2010, 1993-2068, 2106, 2069-2106, 2108,
2107-2109, 2109-3995, 4563, 4646, 4774, 4895, 4899, 4901, 4919, 213, 1840,
1846-1847, 2110-2112, 2121
...
$ vim.basic --version
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Aug 27 2024 05:34:22)
Included patches: 1-16, 647, 17-579, 1969, 580-647, 678, 648-1848, 4975,
5016, 5023, 5072, 2068, 1849-1854, 1857, 1855-1857, 1331, 1858, 1858-1859,
1873, 1860-1969, 1992, 1970-1992, 2010, 1993-2068, 2106, 2069-2106, 2108,
2107-2109, 2109-3995, 4563, 4646, 4774, 4895, 4899, 4901, 4919, 213, 1840,
1846-1847, 2110-2112, 2121
...
Then I logged out and re-login the system, run 'crontab -e', the error still
shows. Maybe I got bad luck today. :(
Regards.
Andy Smith
2024-09-13 22:50:01 UTC
Permalink
Hi,
Post by Marcus Park
either $EDITOR or $VISUAL in my system is empty.
And /usr/bin/editor points to nano.
Well, I do not really understand what is going on then as you are
definitely running an editor that looks at vim config files, and
nano won't do that.

I assume you are looking at the environment of the same user that is
executing "crontab -e"?

When the editor from "crontab -e" is running, you could go into
another terminal and look at all your processes to see which actual
binary is being called. IIRC, vim when invoked as vi, acts in vi
compat mode and that may be why it can't parse its own system
config. Although still it is a mystery to me why you do not get
nano.

I just ran crontab -e as a fresh user and it actually invoked
/usr/bin/sensible-editor and asked me which editor I wanted to use
(now and in future). So perhaps the man page for crontab is out of
date. It seems that sensible-editor records this choice in
~/.selected_editor. Is this what got called for you? If so,
apparently running "select-editor" will change the choice.

Thanks,
Andy
--
https://bitfolk.com/ -- No-nonsense VPS hosting
Greg Wooledge
2024-09-14 01:00:01 UTC
Permalink
Post by Andy Smith
I just ran crontab -e as a fresh user and it actually invoked
/usr/bin/sensible-editor and asked me which editor I wanted to use
(now and in future). So perhaps the man page for crontab is out of
date.
Agreed.

hobbit:~$ strings /usr/bin/crontab | grep usr/bin/
/usr/bin/sensible-editor

The man page is simply wrong, I think.
Loading...