Page 1 of 1

ouput.log is in protected folder

Posted: Thu Mar 02, 2017 2:46 am
by Richard_Wood
"Schematron validation should not write on disk. It tried to write to: C:\Program Files\Oxygen XML Editor 18\output.log. This is not allowed for security reasons."

I am getting the message above currently when trying to run a Schematron validation (which I have been successful at running 1000X previously).
Something has changed in my configuration/preferences. (Probably while I was trying to get a document() function to work in an XSLT style sheet. )

I'd like to know how to set the location of output.log, so that when whatever is failing, fails, I can see the message.
Can anyone tell me how to do this?

Here is more information:

When researching this issue online, the answer seems to always be: "it's writing to where ever you told it to write in your Apache log4j.properties file"

Well, this isn't a WAR file version of OxygenXML and I don't believe that I have an Apache log4j.properties file on my Windows 7 PC.

I am running OxygenXML Editor 18.0

Looking at the installation.log file I see:

Search "log4j.properties" (2 hits in 1 file)
C:\Program Files\Oxygen XML Editor 18\.install4j\installation.log (2 hits)
Line 2938: Install file: C:\Program Files\Oxygen XML Editor 18\frameworks\dita\DITA-OT2.x\resources\log4j.properties; size: 535 bytes; exists: false
Line 3260: Install file: C:\Program Files\Oxygen XML Editor 18\frameworks\dita\DITA-OT\log4j.properties; size: 225 bytes; exists: false

AND

Search "log4j" (11 hits in 1 file)
C:\Program Files\Oxygen XML Editor 18\.install4j\installation.log (11 hits)
Line 2938: Install file: C:\Program Files\Oxygen XML Editor 18\frameworks\dita\DITA-OT2.x\resources\log4j.properties; size: 535 bytes; exists: false
Line 3260: Install file: C:\Program Files\Oxygen XML Editor 18\frameworks\dita\DITA-OT\log4j.properties; size: 225 bytes; exists: false
Line 13199: Install file: C:\Program Files\Oxygen XML Editor 18\lib\log4j.LICENSE.txt; size: 11524 bytes; exists: false
Line 13200: Install file: C:\Program Files\Oxygen XML Editor 18\lib\log4j.jar; size: 367444 bytes; exists: false
Line 13278: Install file: C:\Program Files\Oxygen XML Editor 18\lib\xproc\calabash\lib\log4j-2.LICENSE.txt; size: 11358 bytes; exists: false
Line 13279: Install file: C:\Program Files\Oxygen XML Editor 18\lib\xproc\calabash\lib\log4j-api-2.1.jar; size: 133531 bytes; exists: false
Line 13280: Install file: C:\Program Files\Oxygen XML Editor 18\lib\xproc\calabash\lib\log4j-core-2.1.jar; size: 824749 bytes; exists: false
Line 13281: Install file: C:\Program Files\Oxygen XML Editor 18\lib\xproc\calabash\lib\log4j-slf4j-impl-2.1.jar; size: 22542 bytes; exists: false
Line 13987: Install file: C:\Program Files\Oxygen XML Editor 18\tools\ant\lib\ant-apache-log4j.jar; size: 8637 bytes; exists: false
Line 13988: Install file: C:\Program Files\Oxygen XML Editor 18\tools\ant\lib\ant-apache-log4j.pom; size: 2742 bytes; exists: false
Line 14028: Install file: C:\Program Files\Oxygen XML Editor 18\tools\config\log4j.xml; size: 1095 bytes; exists: false

Re: ouput.log is in protected folder

Posted: Thu Mar 02, 2017 11:04 am
by alex_jitianu
Hi Richard,

So inside the Schematron you are writing log data inside the output.log file. When someone opens a document inside oxygen that document is automatically validated (without the user even knowing). Because of that we run the validation in a sandbox and we don't allow certain actions, like for example accessing the file system. for debugging reason your Schematron tries to write some log and runs into this restriction.

What you can do is to move your Schematron inside the framework (document type) directory. We consider this to be a safe location since users are knowingly installing frameworks. If you don't have a framework then you can just add the directory where the Schematron resides as an "Additional frameworks location" (you'll have to go to Options->Preferences, on page Document Type Association / Locations).

Best regards,
Alex

Re: ouput.log is in protected folder

Posted: Fri Mar 03, 2017 3:21 am
by Richard_Wood
Alex,

Thank-you for the reply.

I am clear on what you mean by most of your post. I did go to
Options->Preferences, on page Document Type Association / Locations
and fiddle around a bit, but ultimately went back to using the Default value.

Then, much to my frustration, the problem vanished. But it was also being experienced by another user and I am waiting to see if he is still having the same problem.

In the meantime, I'd like to respond to your post in hopes of better understanding what you were saying.
I was thinking that there would be a place where I could set the location of output.log, but you don't mention being able to do that.
I don't mean to be rude in any of my comments below, I am just unfamiliar with most of what you were telling me, but I'd like to understand.

When you wrote:
So inside the Schematron you are writing log data inside the output.log file. When someone opens a document inside oxygen that document is automatically validated (without the user even knowing). Because of that we run the validation in a sandbox and we don't allow certain actions, like for example accessing the file system. for debugging reason your Schematron tries to write some log and runs into this restriction.
Are you saying that something that I wrote is trying to write to output.log? Or are you saying that because I am running a Schematron validation schema inside of Oxygen, that some Oxygen or Schematron piece of software is trying to write to output.log?

I am pretty certain that I am not trying to write to output.log. I don't even know what that is or how to write to it. I just know it was crashing my attempts to run a Schematron Schema validation.

Then you wrote:
What you can do is to move your Schematron inside the framework (document type) directory. We consider this to be a safe location since users are knowingly installing frameworks.
I don't know what a framework directory is. I am pretty sure I am not "installing" them, whatever that means.

You continue:
If you don't have a framework then you can just add the directory where the Schematron resides as an "Additional frameworks location" (you'll have to go to Options->Preferences, on page Document Type Association / Locations).
Aha, this sounded promising. Except that nothing had changed so why now do I need to go set this location? Also, I have Schematron schemas in lots of different places: On my local machine, on a file server, on a web server. I have always been able to point to them where ever they are and just use them for validation.

Regards,

Rich Wood

Re: ouput.log is in protected folder

Posted: Fri Mar 03, 2017 11:08 am
by alex_jitianu
Hi Richard,
I was thinking that there would be a place where I could set the location of output.log, but you don't mention being able to do that.
I didn't say anything about that because I don't know who tries to write to this output.log file.
Are you saying that something that I wrote is trying to write to output.log? Or are you saying that because I am running a Schematron validation schema inside of Oxygen, that some Oxygen or Schematron piece of software is trying to write to output.log?

I am pretty certain that I am not trying to write to output.log. I don't even know what that is or how to write to it. I just know it was crashing my attempts to run a Schematron Schema validation.
By default Oxygen doesn't log anything to the file system. We are indeed using log4j as the logging library but we only activate it when we decide we need debugging information from an user. This activation is done by sending the user a log4j.properties that must be placed inside Oxygen's installation directory. But I don't believe that what happens in your case comes from our configuration file because:
1. We never log inside "Program Files" (the path from the error was "C:\Program Files\Oxygen XML Editor 18\output.log")
2. We always call our log file "oxygen.log" (not "output.log")
Because of the above points, I assumed that something from your Schematron must be writing to this output.log file. Are you using any external libraries or extension functions? if you search for output.log in the Schematron files, do you get any hits?
Then, much to my frustration, the problem vanished. But it was also being experienced by another user and I am waiting to see if he is still having the same problem.
The code that writes to output.log might activate only for certain contexts.
I don't know what a framework directory is. I am pretty sure I am not "installing" them, whatever that means.
A framework is a configuration that, together with a set of resources, offers extended support for a specific type of documents. For example, for DITA documents, we have such a built-in framework. Users can create such configurations themselves. On the disk, their concrete form is a directory containg a number of files.
Aha, this sounded promising. Except that nothing had changed so why now do I need to go set this location? Also, I have Schematron schemas in lots of different places: On my local machine, on a file server, on a web server. I have always been able to point to them where ever they are and just use them for validation.
The Schematron files from these locations will be considered safe and run with all permissions. As long as the Schematron doesn't do any potentially unsafe operations (like writing to the file system) it doesn't matter where they reside.
Best regards,
Alex

Re: ouput.log is in protected folder

Posted: Fri Mar 10, 2017 6:56 pm
by adrian
Hi,

So, to clarify, Alex was not aware of this, but output.log and error.log are files created in the application directory (if write access is available) by the Oxygen executable (.exe) launchers where the standard output (stdout) and standard error (stderr) messages (if any) of the Oxygen Java process are redirected.

Most likely when you run the Schematron validation there is a message that the engine or transformer slips to the standard output and that's why there is an attempt to write to "output.log". If you start Oxygen via the .bat launcher, you can check in the command line console for any messages that are logged there during the validation.

Regards,
Adrian

Re: ouput.log is in protected folder

Posted: Mon Jul 10, 2017 11:37 pm
by Richard_Wood
:D Solved,

Thanks Adrian!
We finally had this issue re-occur and were able to track down the issue. We opened a CMD window on our PC, changed directory to the Oxygen bin folder: "C:\Program Files\Oxygen XML Editor 18" then started Oxygen using oxygen.bat

When the error occurred, the message was written to the CMD window and we were able to see what was failing. Oxygen was unable to connect to a server to obtain an XML file.

Thank-you for the solution of running oxygen from a terminal window.

Regards,

Rich Wood