Skip to content
This repository has been archived by the owner on Sep 5, 2020. It is now read-only.

Configuration files not created on Mac OSX Mavericks #332

Closed
HSPDev opened this issue Oct 21, 2014 · 23 comments
Closed

Configuration files not created on Mac OSX Mavericks #332

HSPDev opened this issue Oct 21, 2014 · 23 comments

Comments

@HSPDev
Copy link

HSPDev commented Oct 21, 2014

I just followed the guide and installed it globally using the command, which used curl.

Now I'm attempting to "ignite" my test directory and no matter what I do, it keeps telling me the configuration has been created but it does not exist!

How is this happening? I'm pretty sure it's a bug, as I've also tried the "loca to the folderl" version, and both the local and global composer versions. Nothing works! It keeps telling me the files are there, but they are not.

Screenshot of bug

(I've shutdown the droplet and created another one - just a quick one to try it out so no worries)

Also your documentation seems a little bit frustrating. I will help write something more friendly when I get up and running myself.. I'm so tired of Capistrano that you wouldn't even believe, so please help me get away!! 😨

@HSPDev
Copy link
Author

HSPDev commented Oct 21, 2014

Never mind I fixed it. Meanwhile i discovered Deployer which also seems nice, and nearly went for it, considering I found other bug reports of this, from 8 days ago and it was updated, but the phar was never re-uploaded. Whatever, it's opensource and stuff happens.

For anybody wanting to fix this themselves, they should clone / zip download, the develop branch, and cd into the bin directory inside, and run php compile (or just ./compile). This will create a nice rocketeer.phar file, which they can then move to /usr/local/bin/rocketeer and chmod 755. Voila, it's fixed!
(You can also use this locally as php rocketeer.phar).

I've uploaded the file on mirrorupload in case you are lazy, and trust me (you can do that):
Download fixed rocketeer.phar

@Anahkiasen
Copy link
Member

Well actually the PHAR should be up to date, this means the bug might not be fixed.

@HSPDev
Copy link
Author

HSPDev commented Oct 21, 2014

Well.. I was too fast on the trigger.

It will create the config files now, but when I run any other command, it will not load them and will just keep telling me to setup my connections, using the wizard.

I can understand you are the primary guy @Anahkiasen ? Take my Skype and Email and I will help you track it down.
hsp@hsp.dk
HSPSoftware

Or if you don't have time, could you point me in the general direction? (I'm totally new at this tool) - I feel like bug hunting! 😸

@zupolgec
Copy link
Contributor

+1 having the same issue with the .phar
I answer all the questions but then there is no .rocketeer folder

@HSPDev
Copy link
Author

HSPDev commented Oct 21, 2014

@zupolgec Try and download mine, or follow my instructions to compile it. It should work, at least to create the folder. I'm trying to get an impression of the tool right now, and hunt this bug down. Damn I hope it's worth it...

@zupolgec
Copy link
Contributor

Yep, compiling from repo works for me! Thanks @HSPSoftware

@HSPDev
Copy link
Author

HSPDev commented Oct 21, 2014

@zupolgec Don't be too fast. It might create the configuration files, but will it find them and use them? Cause it will not for me! 😢

@Anahkiasen
Copy link
Member

If the PHAR is not working what I'd recommend instead is just doing composer global require anahkiasen/rocketeer:your-version and using the global binary, might be less hassle than cloning the repo.

@HSPDev
Copy link
Author

HSPDev commented Oct 21, 2014

@Anahkiasen I'm not sure we understand each other. I get a new error now.

The .rocketeer/ folder is created. But now, when I run any command (e.g. rocketeer deploy), it just ignores the folder, and gives me that wizard once more, to fill everything in. If I do it again, it updates the .rocketeer/ folder, but it will not use it, no matter what I do.

I haven't changed anything inside the source code yet, but I'm about too. It's a pretty big project, so I'm currently tracking everything down. Currently I'm hunting inside the ConnectionsHandler. As far as I can tell, the configuration files are being loaded, but some statement somewhere is going wrong, and causing them to be ignored.

I will post back when I find something new, or if any of you have some input on this.

@Anahkiasen
Copy link
Member

Can you do just rocketeer and paste the first three lines about where Rocketeer thinks the config is ?

@HSPDev
Copy link
Author

HSPDev commented Oct 21, 2014

I don't understand what you want me to do.

I've tried to var_dump (old school!) every place it loads it's configuration, and the results of that, and it seems to be performing like it should.

I'm looking at CredentialsGatherer.php right now, on line 65.

$availableConnections is non-empty, and gets the credentials from my configuration as it should. I suspect $activeConnections is somehow returning something which evaluates to false.

Could you help me out?

@HSPDev
Copy link
Author

HSPDev commented Oct 21, 2014

Yup. Inside ConnectionHandler.php, in getConnections()

The $connections variable is just:

array(1) {
  [0]=>
  string(4) "prod"
}

And $default is equal to NULL.

This is where the bug is started, as the return value will then make the if() inside CredentialsGatherer.php (line 65) fail.. Could you explain why this is happening? I will continue hunting..

@Anahkiasen
Copy link
Member

I mean like, type rocketeer in the command line, it should display at the top where Rocketeer thinks files are:

Rocketeer version 2.0.0

Current state
  application     {application_name}
  configuration   /Users/anahkiasen/Sites/anahkiasen/registry/.rocketeer
  tasks           /Users/anahkiasen/Sites/anahkiasen/registry/.rocketeer/tasks
  events          /Users/anahkiasen/Sites/anahkiasen/registry/.rocketeer/events
  logs            /Users/anahkiasen/Sites/anahkiasen/registry/.rocketeer/logs

@HSPDev
Copy link
Author

HSPDev commented Oct 21, 2014

Rocketeer version 2.0.1

Current state
  application     testing_hsp
  configuration   /Users/hsp/Desktop/test/.rocketeer
  tasks           /Users/hsp/Desktop/test/.rocketeer/tasks
  events          /Users/hsp/Desktop/test/.rocketeer/events
  logs            /Users/hsp/Desktop/test/.rocketeer/logs

@Anahkiasen
Copy link
Member

Well weird, that's correct. So it's more of a configuration issue in the connections than a folder issue indeed. Can you show me your .rocketeer/config.php file (sans passwords) ?

@HSPDev
Copy link
Author

HSPDev commented Oct 21, 2014

<?php
use Rocketeer\Services\Connections\ConnectionsHandler;

return array(

    // The name of the application to deploy
    // This will create a folder of the same name in the root directory
    // configured above, so be careful about the characters used
    'application_name' => 'testing_hsp',

    // Plugins
    ////////////////////////////////////////////////////////////////////

    // The plugins to load
    'plugins' => array(
        // 'Rocketeer\Plugins\Slack\RocketeerSlack',
    ),

    // Logging
    ////////////////////////////////////////////////////////////////////

    // The schema to use to name log files
    'logs'             => function (ConnectionsHandler $connections) {
        return sprintf('%s-%s-%s.log', $connections->getConnection(), $connections->getStage(), date('Ymd'));
    },

    // Remote access
    //
    // You can either use a single connection or an array of connections
    ////////////////////////////////////////////////////////////////////

    // The default remote connection(s) to execute tasks on
    'default'          => array('prod'),

    // The various connections you defined
    // You can leave all of this empty or remove it entirely if you don't want
    // to track files with credentials : Rocketeer will prompt you for your credentials
    // and store them locally
    'connections'      => array(
        'production' => array(
            'host'      => 'hsp.dk',
            'username'  => 'root',
            'password'  => 'tihihihihihihihiihihihihihihiihih',
            'key'       => '',
            'keyphrase' => '',
            'agent'     => '',
        ),
    ),

    // Contextual options
    //
    // In this section you can fine-tune the above configuration according
    // to the stage or connection currently in use.
    // Per example :
    // 'stages' => array(
    //  'staging' => array(
    //      'scm' => array('branch' => 'staging'),
    //  ),
    //  'production' => array(
    //    'scm' => array('branch' => 'master'),
    //  ),
    // ),
    ////////////////////////////////////////////////////////////////////

    'on' => array(

        // Stages configurations
        'stages'      => array(),

        // Connections configuration
        'connections' => array(),

    ),

);

@Anahkiasen
Copy link
Member

Shouldn't default be['production'] instead of ['prod'] ? Or is that leftover from debugging ?

@zupolgec
Copy link
Contributor

@HSPSoftware I tried with the compiled phar and it works. The only question I get is "No password is set for [repository], please provide one:" that can be avoided by setting username and password to null in scm.php

@HSPDev
Copy link
Author

HSPDev commented Oct 21, 2014

It doesn't make a difference as far as I can tell. I don't know why they missmatch, as I haven't changed this manually. Is this another bug? Let's not worry about that for now!

Let me just try and re ignite my directory. IF @zupolgec is right and you @Anahkiasen can't see the problem, it might be me who have fucked up.

@HSPDev
Copy link
Author

HSPDev commented Oct 21, 2014

Okay that's scare. Where do it store it's global configuration? I just deleted the entire .rocketeer folder inside my test directory, and ran my modified debugging version, and it dumped out a lot of my testing date, so maybe some global state is fucking with me?

@HSPDev
Copy link
Author

HSPDev commented Oct 21, 2014

I think I got it

It wooorks

It did this by changing CredentialsGatherer.php line 65 to

if (empty($activeConnections) || empty($availableConnections)) {

@Anahkiasen
Copy link
Member

Okay that's scare. Where do it store it's global configuration? I just deleted the entire .rocketeer folder inside my test directory, and ran my modified debugging version, and it dumped out a lot of my testing date, so maybe some global state is fucking with me?

There is a global storage in ~/.rocketeer. I think rocketeer flush should delete it for the current app.

@HSPDev
Copy link
Author

HSPDev commented Oct 22, 2014

Thank you! The line I changed should probably go into the project source, I'm just too lazy to do a pull request and all that, it's not often I'm in the Opensource environment.

@HSPDev HSPDev closed this as completed Oct 22, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants