Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webmin TKLBAM Restore in Jessie 14 Causes failure (Webshell works) #455

Closed
l-arnold opened this issue Sep 9, 2015 · 12 comments

Comments

Projects
None yet
5 participants
@l-arnold
Copy link

commented Sep 9, 2015

Webmin TKLBAM Restore returns following error and loses the full Webmin Interface Requires BACK to exit): Seems an error in CODE. Immediately issued restore command in WebShell and process started (and continues)

(Webmin Error)
Error - Perl execution failed

syntax error at /usr/share/webmin/tklbam/restore_run.cgi line 9, near "skip_packages skip_files skip_database limits)"
(Might be a runaway multi-line () string starting on line 7)
syntax error at /usr/share/webmin/tklbam/restore_run.cgi line 12, near "}"
Can't use global @_ in "my" at /usr/share/webmin/tklbam/restore_run.cgi line 17, near "= @"
syntax error at /usr/share/webmin/tklbam/restore_run.cgi line 38, near "}"
Can't use global @
in "my" at /usr/share/webmin/tklbam/restore_run.cgi line 41, near "= @_"
syntax error at /usr/share/webmin/tklbam/restore_run.cgi line 50, near "}"

@JedMeister JedMeister added this to the 14.0 milestone Sep 9, 2015

@JedMeister

This comment has been minimized.

Copy link
Member

commented Sep 9, 2015

Thanks for reporting. This looks like it really needs atention and I must admit that I hadn't tested that. Glad you did! 👍

@alonswartz

This comment has been minimized.

Copy link
Member

commented Sep 9, 2015

@l-arnold thanks for the heads up! What appliance / version are you testing against? Does this only happen in webmin or do you also receive errors when running from the CLI?

@l-arnold

This comment has been minimized.

Copy link
Author

commented Sep 9, 2015

Seems only ro happen in Webmin. Worked fine in shell. From our new Odoo but based off Lapp. I recall this a while ago and had thought I reported but may have only put in the forums. ??

I don't feel it is an Odoo specific prob,
l-arnold/tkl-nomadic-odoo#14

@wyzelli

This comment has been minimized.

Copy link

commented Oct 30, 2015

I just discovered this as well, and it is a Perl syntax error - the script is using quoted words including the word 'time' which I believe is a reserved word in current release of Perl.

I made some minor changes to the code and resolved the problem, by explicitly quoting the string.

I changed line 7 of the restore_run.cgi from:

foreach my $var qw(skpp id force passphrase
                   time escrow escrow_filename
                   skip_packages skip_files skip_database limits) {

to

foreach my $var ('skpp', 'id', 'force', 'passphrase',
                 'time', 'escrow', 'escrow_filename',
                 'skip_packages', 'skip_files', 'skip_database', 'limits') {

And then the restore ran with no error.

Peter

@wyzelli

This comment has been minimized.

Copy link

commented Nov 2, 2015

Further research cause me to believe this is actually a Perl issue which has been fixed in a later release. Perl is currently 5.22.x and Jessie runs 5.20.x by default.

This can also be fixed by enclosing the entire qw(skpp ... ) expression in parens like so: (qw(skpp ... ))

(or by updating the Perl Distro)

Peter

@JedMeister

This comment has been minimized.

Copy link
Member

commented Nov 3, 2015

@wyzelli - Thanks tons for the info and the workaround. We'll need to implement that ASAP...

@wyzelli

This comment has been minimized.

Copy link

commented Nov 3, 2015

@JedMeister You're welcome. It looks like the script would need to be modified since Perl no longer supports the qw(skpp ...) syntax in certain contexts. This appears to be a syntax that was not supported in 5.8, then was in 5.14 (by default in Wheezy) then removed again in 5.20, so 5.22 won't fix it unfortunately (I have just tested that on my own machine - it still gives the syntax error). So it isn't really a Perl bug so much as a syntax change that has passed through unawares.

I have not checked any of the other perl programs on the Jessie distro for this issue, but If I get some time I will.

Peter

@wyzelli

This comment has been minimized.

Copy link

commented Nov 4, 2015

@JedMeister As far as I can tell, the only other files in the /usr/share/webmin/tklbam directory which would be affected by this issue are : log_parser.pl and tklbam-lib.pl

@JedMeister

This comment has been minimized.

Copy link
Member

commented Nov 4, 2015

@wyzelli - Awesome! You rock!

@lirazsiri

This comment has been minimized.

Copy link
Member

commented Nov 4, 2015

Thanks guys. I'll commit a change and we'll update the package repository ASAP.

@lirazsiri

This comment has been minimized.

Copy link
Member

commented Nov 19, 2015

I committed the fix to the offending line of code and also removed other uses of qw for good measure just in case Perl continues to "evolve" that part of its syntax. Sorry for the slow response. The fix was indeed very simple but I figured it would be a good idea to pre-emptively remove other uses of qw and that required me to carve out a larger chunk of time for testing.

Hopefully by tomorrow the repo will be updated and this will go out as an automatically installed package update.

@lirazsiri lirazsiri closed this Nov 19, 2015

@l-arnold

This comment has been minimized.

Copy link
Author

commented Nov 19, 2015

Nice work guys!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.