Bug 62625 - A Scripting Framework error occurred while running the UNKNOWN script UNKNOWN.
Summary: A Scripting Framework error occurred while running the UNKNOWN script UNKNOWN.
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
4.0.0.3 release
Hardware: Other All
: medium critical
Assignee: Justin L
URL:
Whiteboard: target:5.3.0 target:5.2.4
Keywords: bibisectNotNeeded, dataLoss
Depends on:
Blocks:
 
Reported: 2013-03-22 08:07 UTC by Maikel Alderhout
Modified: 2017-05-18 19:00 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot with the message (91.63 KB, image/png)
2013-03-22 08:07 UTC, Maikel Alderhout
Details
macro.xls: open from smb://server/share/macro.xls to see the error. (106.50 KB, application/vnd.ms-excel)
2016-10-25 12:16 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Maikel Alderhout 2013-03-22 08:07:15 UTC
Created attachment 76893 [details]
Screenshot with the message

Message: Incorrect format for Script URI: 

Hi,

I am using an existing MS xls document with some simple macro's.

I use this macro succesfully (after setting macro security to low)

But, after saving this document and reload it again I get this message when I want to use the macro again. 

Greets,
Maikel
Comment 1 Buovjaga 2014-11-07 14:56:51 UTC
Please attach a document for testing and set as UNCONFIRMED.
Comment 2 QA Administrators 2015-05-06 14:15:14 UTC Comment hidden (obsolete)
Comment 3 QA Administrators 2015-06-08 14:27:00 UTC Comment hidden (obsolete)
Comment 4 Justin L 2016-10-25 12:16:50 UTC
Created attachment 128244 [details]
macro.xls: open from smb://server/share/macro.xls to see the error.

Key concept: must open from Windows share via smb://xx/x/file.xls to see the macro error provided in the bug's description. It works fine if opened from a CIFS mount.
Key concept: must be .xls format.  It works fine in .ods format. (I don't know about .xlsx since I can't easily produce that.)

My testing scenario: Windows 2003 server providing the windows share, Clients are Ubuntu 16.04 and Mint 12.04. 

Tested with LO 5.3 all the way back to where the document first loaded in last41onmaster, always with the same results.
Comment 5 Rik Shaw 2016-10-26 05:02:45 UTC
One additional comment regarding opening an .xls file with VBA macros from a gvfs / samba share: I am *not* prompted to enable the macros when the document opens.  The macros are somewhat enabled, resulting in the the error, but something is corrupting to not prompt the user to enable them on load.

To confirm Justin L's observation, When opening the file with a CIFS connection via /etc/fstab and the same .xls file, I am prompted to enable the macros, and then the macro when executed will complete successfully.

The same behavior is present with either a Windows File Server, or Samba running on a Linux server.
Comment 6 Justin L 2016-10-26 12:52:02 UTC
critical: data loss of macro code.  Since the macros code is not read during the loading of the file, it isn't available during the save phase, and thus is lost.

medium: affects a small subset of users.
Comment 7 Justin L 2016-10-26 17:06:23 UTC
starting point for a discussion on how to properly fix this: https://gerrit.libreoffice.org/30303 tdf#62625 - reopen stream to readBasic VBA over SMB
Comment 8 Justin L 2016-10-26 18:06:15 UTC
Windows doesn't seem to have a problem with an .xls with macros over a SMB share. Marking as Linux only. Perhaps only a problem in Gio (Gnome?) code.
Comment 9 Justin L 2016-10-27 05:58:12 UTC
Linux: also affects protocols sftp:, http:, dav:
Windows: affects remote file - webdav service.

Reproduction steps
1.) copy macro.xls test document to the remote site somehow.
2.) open Libreoffice and enable macros via: tools - options - security - macro security - Medium (prompt to enable macros).
3.) open macro.xls from http://, or sftp://, or smb://

4a.) if it asks to enable macros, that is good.  You can just disable for safety’s sake.  If it loads without prompting about macros, click on a button and see the bug’s error message. Saving a copy of that locally would be missing
4b.) if loading the macros worked, save a copy locally, and confirm that it round-trips fine.  It will.
Comment 10 steve -_- 2016-10-27 08:55:06 UTC
Tested on macOS 10.12.1 + LO Version: 5.3.0.0.alpha0+
Build ID: 40fc2c1a0d2ebdf47131651045107c9d5abb850d
CPU Threads: 4; OS Version: Mac OS X 10.12.1; UI Render: default; 
TinderBox: MacOSX-x86_64@49-TDF, Branch:master, Time: 2016-10-20_06:13:56
Locale: de-DE (de_DE.UTF-8); Calc: group

Opening this file http://www.ajaxfilebrowser.com/User05b65ad/macro.xls via Start Center > Remote files and WebDAV results in:

* the file being opened
* no macro dialog to be shown (despite security settings for macros being set to "medium" at LibreOffice > Preferences > Security)

Clicking any of the macro buttons results in the following error msg:

A Scripting Framework error occurred while running the UNKNOWN script UNKNOWN.
Message: Incorrect format for Script URI:
Comment 11 Commit Notification 2016-11-07 08:49:10 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=d9c7b0a01162254240a1328fa594991eccf6bc65

tdf#62625 - reopen temp stream to readBasic .xls VBA

It will be available in 5.3.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 12 Commit Notification 2016-11-07 15:57:55 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "libreoffice-5-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=07b1e1025653c05f6422278da793261cbff42c71&h=libreoffice-5-2

tdf#62625 - reopen temp stream to readBasic .xls VBA

It will be available in 5.2.4.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.