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

TERMINUS_ROOT not set throws exception #1446

Closed
spiderwisp opened this issue Dec 14, 2016 · 20 comments
Closed

TERMINUS_ROOT not set throws exception #1446

spiderwisp opened this issue Dec 14, 2016 · 20 comments
Milestone

Comments

@spiderwisp
Copy link

spiderwisp commented Dec 14, 2016

Expected behavior

Expect terminus to run using cygwin with php 5.5.28

Actual behavior

Fatal error: Uncaught exception 'Pantheon\Terminus\Exceptions\TerminusException' with message 'Could not locate root to set TERMINUS_ROOT.' in C:\cygwin64\home\wiz\terminus\src\Config\DefaultsConfig.php:70
Stack trace:
#0 C:\cygwin64\home\wiz\terminus\src\Config\DefaultsConfig.php(18): Pantheon\Terminus\Config\DefaultsConfig->getTerminusRoot()
#1 C:\cygwin64\home\wiz\terminus\bin\terminus(36): Pantheon\Terminus\Config\DefaultsConfig->__construct()
#2 {main}
  thrown in C:\cygwin64\home\wiz\terminus\src\Config\DefaultsConfig.php on line 70

Steps to reproduce the behavior

$ bin/terminus -vvv

@TeslaDethray
Copy link
Contributor

@spiderwisp I cannot duplicate this issue. This occurs when Terminus cannot locate its own root directory because its composer.json file is missing. Is it possible that your copy's composer.json file was moved?

@spiderwisp
Copy link
Author

I've triple-checked and my composer.json file is fine. I've replaced it several times with fresh copies. I'm facing this issue after getting around this issue #1443 (comment) which I did by using an older version of Terminus and php.

@makbeta
Copy link

makbeta commented Jan 10, 2017

Experiencing the same issue.
The only warning I got during the installation as follows, not sure if that's applicable.

<warning>Skipped installation of bin bin/terminus.bat for package pantheon-systems/terminus: file not found in package</warning>

@TeslaDethray
Copy link
Contributor

@makbeta terminus.bat was the autocomplete file for >Terminus 0.7. How did you install Terminus? Was it Homebrew?

@makbeta
Copy link

makbeta commented Jan 11, 2017

@TeslaDethray No, I'm on Windows and used the curl command to install Terminus, as mentioned in Pantheon Guide. I did have a Terminus v0.13 installed before that, but I first removed it with a composer command before installing a new one.

@ghost
Copy link

ghost commented Jan 17, 2017

Confirming this issue

PHP 5.6.21
Attempted update from terminus v0.13
Installed via CURL from git bash (mintty) on Win 10 x64
Same warning regarding bin/terminus.bat

@danheisel
Copy link

Confirming the issue as well.

Clean install with PHP 5.6.21 on a Win 10 x64 machine. Followed the same steps for another machine that is working fine. The other machine was set up about two months ago.

@danheisel
Copy link

Rolling back to 0.13.5 at least allowed me to get Terminus going on this new machine without a hitch. I was receiving the errors with beta 2.

@dan-ddb
Copy link

dan-ddb commented Jan 20, 2017

I am experiencing the same error. I ran the installer which gave me beta 2. I am running php 7.0.15 and the error appears both in windows cmd.exe as well as git bash.

Windows Server 2012 (64bit)

Also received this error during installation:

Skipped installation of bin bin/terminus.bat for package pantheon-systems/terminus: file not found in package

Does anyone have step by step instructions for installing an older version of terminus via composer?

note: it appears the PHP function in question getTerminusRoot() is looking for directories separated by forward slash '/' and can't identify the windows directory structure properly.

@danheisel
Copy link

For me, I just pulled down 0.13.5 into a new folder and ran the composer install as normal from that new folder. All seems to be going fine now. I had installed alpha 2 on another laptop and it works perfectly fine.

@joshkoenig
Copy link
Member

We likely need to use DIRECTORY_SEPARATOR when locating composer.json to determine the root:

if (file_exists("$current_dir/composer.json")) {

@tessak22
Copy link

@makbeta How did you resolve your error as I am also receiving the same error. I am on a new computer with literally no changes made so I am curious if I am missing some major installation or configuration.

Skipped installation of bin bin/terminus.bat for package pantheon-systems/terminus: file not found in package

@greg-1-anderson
Copy link
Member

I don't believe you need DIRECTORY_SEPARATOR for file_exists(); PHP should convert filepaths for built-in commands. It is necessary when calling exec et. al.

Problem is probably somewhere else. Haven't tried to reproduce though.

@joshkoenig
Copy link
Member

@greg-1-anderson PHP isn't so good if there are mixed sets of separators. User reported that hard-coding in a \ got it working.

@tessak22 - that terminus.bat warning should not prevent you from successfully using terminus. If we can reproduce it, we should create a separate lower-priority issue.

@makbeta
Copy link

makbeta commented Jan 20, 2017

@tessak22 I was not able to resolve the issue. Because I was pressed for time and have relatively few site on Pantheon, I just skipped the terminus approach and got things done via the FTP.

@TeslaDethray TeslaDethray modified the milestones: 1.0.0, 1.0.1 Jan 23, 2017
TeslaDethray pushed a commit that referenced this issue Jan 25, 2017
Windows compatibility fixes and Appveyor addition
@RoloDMonkey
Copy link

I am getting this error for a fresh install on MacOS Sierra v10.12.3.

@ghost
Copy link

ghost commented Feb 10, 2017

Experiencing the same problem:

Writing lock file
Generating autoload files
    <warning>Skipped installation of bin bin/terminus.bat for package pantheon-systems/terminus: file not found in package</warning>

                                                                                                       
  [Symfony\Component\Filesystem\Exception\IOException]                                                 
  Failed to create symbolic link from "/Users/paul/vendor/bin/terminus" to "/usr/local/bin/terminus".  
                                                                                                       

install [--bin-dir [BIN-DIR]] [--install-dir [INSTALL-DIR]] [--install-version [INSTALL-VERSION]]

Dirac:~ paul$ php -v
PHP 5.5.38 (cli) (built: Aug 21 2016 21:48:49) 
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies
Dirac:~ paul$ 

@dustinleblanc
Copy link
Contributor

@RoloDMonkey there are a few errors mentioned in this issue, so I'll assume you are referring to the lack of a TERMINUS_ROOT? The warning related to terminus.bat can be safely ignored.

@paulbooker The first warning can be ignored, the second warning is likely caused by an existing phar or symlink in /usr/local/bin, just make sure to remove it and you should be able to run the Symlink by hand:

ln -s /Users/paul/vendor/bin/terminus /usr/local/bin/terminus

Another possible cause is that /usr/local/bin is not writable by your user (which is true in Sierra by default I believe). You can either choose to strongarm the system and force writability, or choose to use another folder in your $PATH, the choice is yours.

@jmevalentin
Copy link

I get this error during installation:
- Installing pantheon-systems/terminus (1.0.0) Downloading: 100% <warning>Skipped installation of bin bin/terminus.bat for package pantheon-systems/terminus: file not found in package</warning> symfony/var-dumper suggests installing ext-symfony_debug ()

The section is the issue, and it repeats by itself at the end.

However, running "terminus" at the cli, I get a list of available commands.

@TeslaDethray
Copy link
Contributor

The terminus.bat issue has been fixed and will be shipped with 1.0.1.

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