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

install tool does not (cannot) display errors of install commands #32

Closed
fritzmg opened this issue Oct 4, 2016 · 3 comments
Closed
Assignees
Labels
Milestone

Comments

@fritzmg
Copy link
Contributor

fritzmg commented Oct 4, 2016

If some errors happen while running InstallationController::runPostInstallCommands for example, the errors will not be displayed to the user and the installation might be left in an incomplete state without him knowing. For instance, if some errors happen while creating the symlinks, e.g.:

 ------- ------------------------ --------------------------------------------------------------------------------------------------------------------------------------------------- 
          Symlink                  Target / Error                                                                                                                                     
 ------- ------------------------ --------------------------------------------------------------------------------------------------------------------------------------------------- 
  ERROR   system/themes/flexible   Unable to create symlink due to error code 1314: 'A required privilege is not held by the client'. Do you have the required Administrator-rights?  
  ERROR   web/assets               Unable to create symlink due to error code 1314: 'A required privilege is not held by the client'. Do you have the required Administrator-rights?  
  ERROR   web/system/themes        Unable to create symlink due to error code 1314: 'A required privilege is not held by the client'. Do you have the required Administrator-rights?  
  ERROR   system/logs              Unable to create symlink due to error code 1314: 'A required privilege is not held by the client'. Do you have the required Administrator-rights?  
 ------- ------------------------ ---------------------------------------------------------------------------------------------------------------------------------------------------

These errors are catched by the command and then written to the SymfonyStyle object, which creates the styled output for the command line. That output will go nowhere though, since InstallationController::runPostInstallCommands uses a NullOutput

$command->run(new ArgvInput([]), new NullOutput());

So they are not visible nor logged anywhere.

May be these post-install-commands should be put in an InstallService for example, so that errors can be handled differently by the callers? The contao:symlinks command would then call these functions from the InstallService, catch the errors and display them on the command line as usual, while the InstallationController can catch the errors and then display them in the Install Tool instead.

@fritzmg fritzmg changed the title install tool does not (cannot) display errors happening during setup install tool does not (cannot) display errors of install commands Oct 4, 2016
@leofeyer leofeyer added this to the 1.2.0 milestone Oct 13, 2016
@leofeyer leofeyer self-assigned this Oct 13, 2016
@leofeyer
Copy link
Member

Implemented in 848084b.

@fritzmg
Copy link
Contributor Author

fritzmg commented Oct 24, 2016

Btw. the same problem exists on various other places, where commands are invoked. For instance, if the creation of symlinks fails here: core-bundle/src/Resources/contao/dca/tl_files.php#L685 there will be no entry in the symfony log or system log indicating what the problem might have been.

@leofeyer
Copy link
Member

Changed in contao/core-bundle@8003d04.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants