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

Path to combine cannot be empty error when running without login #945

Closed
ferventcoder opened this issue Sep 1, 2016 · 3 comments
Closed
Assignees
Milestone

Comments

@ferventcoder
Copy link
Member

Following #853, we are still seeing IFIleSystem.combine_paths be passed a left side that is empty

if (leftItem == null) throw new ApplicationException("Path to combine cannot be empty.");
is the error that is thrown.

It would be nice to determine what is being passed as empty to the method. Or at least get an idea of what method called this to make this happen.

@ferventcoder ferventcoder added this to the 0.10.1 milestone Sep 1, 2016
@ferventcoder ferventcoder self-assigned this Sep 1, 2016
@noresjo
Copy link

noresjo commented Sep 2, 2016

One way (for me at least) to get this is to run choco 0.10 choco.exe install -y -d- v notepadplusplysin a scheduled task set to start ONSTART. (run even though noone is logged on).

@mattheyan
Copy link

I too am seeing this behavior, and also think that no user logged in may be the culprit.

In my case, I'm using an automation tool that supports issuing remote commands to an agent, and although I don't fully understand how it works, I believe it uses a system service to execute those commands on the agent and doesn't require a user to be logged in.

I reliably see this error on a machine with no logged in user (shortly after a scheduled reboot) when issuing an install command. The package install script succeeds, but then I see the null ref error that follows it. Something like this:

The install of <package> was successful.
  Software install location not explicitly set, could be in package or 
  default install location if installer.
<package> not installed. An error occurred during installation:
 Value cannot be null.
Parameter name: path1

If I log in to the machine in question, and then issue the same remote command, the install succeeds.

@ferventcoder
Copy link
Member Author

This will be fixed for 0.10.1 thanks to @noresjo providing great log output that immediately identified the problem!

ferventcoder added a commit that referenced this issue Sep 18, 2016
When running from a scheduled task or from being run when no user is
logged into the system, choco was failing on a path combine error when
it should have just moved on. This is happening in cleaning up the
nuget cache that was introduced in 0.9.10. The path combine was
attempting to combine `$env:LocalAppData` with other components.
LocalAppData is a user dependent environment variable and empty when no
user is logged in. Instead look at the path to see if it is null and
return early instead of attempting to clean up the cache.
ferventcoder added a commit that referenced this issue Sep 18, 2016
* stable:
  Remove extra '='
  (spec) fix tests
  (log) auto uninstaller enhancements messaging
  (GH-945) Fix - Fails Installs Running Without User
@ferventcoder ferventcoder changed the title Path to combine cannot be empty Path to combine cannot be empty error when running without login Sep 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants