Skip to content

shell_exec() fails to execute on IIS 10 server  #241

Closed
@pedwik

Description

@pedwik

I get this error when trying to import a repository:
APPLICATION ERROR #plugin_SourceViewVC_run_svn
shell_exec() failed to execute Subversion.
Please use the "Back" button in your web browser to return to the previous page....

Setup:
OS: Window Server 2016 (VPS)
MantisBT version: 2.6
Database: Sql Server 2014 Express
PHP: 7.1.9

Settings made in Source plugin configuration UI:
SVN: Path to binary: C:\csvn\bin
SVN: Command Arguments: Empty
SVN: Trust All SSL certifcates: True
SVN: Use Windows Start : True (tried both)

Activity

bright-tools

bright-tools commented on Sep 13, 2017

@bright-tools
Contributor

Which SVN distribution/version are you using, please?

bright-tools

bright-tools commented on Sep 13, 2017

@bright-tools
Contributor

If my understanding's correct, it should be trying to execute c:\csvn\bin\svn help first of all when you try to import a repo. Could you try that from a command line & check what the output is? Also check that this is accessible by whatever user PHP is effectively executing as?

pedwik

pedwik commented on Sep 13, 2017

@pedwik
Author

Subversion version is 1.8.17 (installed with Collabnet)

pedwik

pedwik commented on Sep 13, 2017

@pedwik
Author

AFAIK, on IIS 10 the application pool identity is the effective "user". This is some sort of virtual account that cannot be used as the user-parameter in a runas (test) command.

bright-tools

bright-tools commented on Sep 13, 2017

@bright-tools
Contributor

Thanks. I can reproduce this, so I'll take a look.

bright-tools

bright-tools commented on Sep 13, 2017

@bright-tools
Contributor

@pedwik - Two issues seem to be at work here, one of which I believe needs a code change (pull request submitted just now), the other of which will need you to add an SVN command argument - see #81 (FYI created an empty directory & used this as the parameter to the arg).

pedwik

pedwik commented on Sep 14, 2017

@pedwik
Author

Since "svn.exe" is added in the code to the path (right?) "SVN: Path to binary" should be the physical path to the folder where svn.exe is located, for example C:\csvn\bin and not C:\csvn\bin\svn.exe. Is this correct? If so, maybe that should be documented shortly in the form.

Concerning the SVN command argument field, should I enter for example
"--config -dir c:\csvn\someEmptyFolder" ? The discussion in #81 is not that 100% clear to me on what the conclusions were.

bright-tools

bright-tools commented on Sep 14, 2017

@bright-tools
Contributor

"SVN: Path to binary" should indeed be the directory containing the binary, as you say. Unfortunately, without the fix I submitted, the configuration options are ignored. It's a simple change, though, so hopefully you can manually update your install?

Regarding the SVN arg, what you have looks to be analogous the what I used (though note that it's --config-dir not --config -dir).

Debugging of failed SVN invocations could do with some improvement, to be honest. I might take a look at that in the future. Let us know how you get on, anyway.

pedwik

pedwik commented on Sep 14, 2017

@pedwik
Author

I added the code change and after that the "shell_exec()" error disappeared. But nothing is imported, a new error message is "svn info returned invalid xml code"

dregad

dregad commented on Sep 14, 2017

@dregad
Member

one of which I believe needs a code change (pull request submitted just now

Just merged the PR into master. I've been planning to cut an official 2.1.0 release for some time, but other priorities keep getting in the way.

dregad

dregad commented on Sep 14, 2017

@dregad
Member

"SVN: Path to binary" should be the physical path to the folder where svn.exe is located, for example C:\csvn\bin and not C:\csvn\bin\svn.exe. Is this correct? If so, maybe that should be documented shortly in the form.

Documentation for this plugin is sorely lacking. Any contribution in this area would be greatly appreciated... something along the lines of the existing "configuring" guides, in https://github.com/mantisbt-plugins/source-integration/tree/master/docs

dregad

dregad commented on Sep 14, 2017

@dregad
Member

a new error message is "svn info returned invalid xml code"

Not sure if it helps, but have a look at #132 where user had the same error message and managed to find a solution to the problem.

bright-tools

bright-tools commented on Sep 14, 2017

@bright-tools
Contributor

I added the code change and after that the "shell_exec()" error disappeared. But nothing is imported, a new error message is "svn info returned invalid xml code"

I had feared as much. Unfortunately the plugin doesn't check for errors & tries to parse the string returned from the SVN command as if the command had succeeded. I'll try and improve the call such that it'll report the error string returned by SVN rather than the XML parse error.

30 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      shell_exec() fails to execute on IIS 10 server · Issue #241 · mantisbt-plugins/source-integration