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

Error: Missing argument, -n or --name is required #44

Open
davemac opened this issue May 9, 2014 · 4 comments
Open

Error: Missing argument, -n or --name is required #44

davemac opened this issue May 9, 2014 · 4 comments

Comments

@davemac
Copy link

davemac commented May 9, 2014

I'm testing the feature/advanced-search-replace branch and when I run:

grunt db_pull --src="production" --dest="local"

I get the following error:

Error: Missing argument, -n or --name is required

I realise that argument is required by advanced-search-replace, but shouldn't the script already have that info from the Gruntfile?

I tried ``grunt db_pull --src="production" --dest="local" -n {database-name}` and a few combinations of that, but now get:

>> Local Npm module "{database-name}" not found. Is it installed?

@davemac
Copy link
Author

davemac commented May 12, 2014

This is still an issue even, when #43 is resolved.

@davemac
Copy link
Author

davemac commented May 14, 2014

Here's what happens:

$ grunt db_pull --src="production" --dest="local"

Running "db_pull" task

Pulling database from 'Production' into Local
Creating dump of Production database
>> Database dump succesfully exported to:
>> backups/production/20140514/15-15-41/db_backup.sql
Creating dump of Local database
Enter password: 
>> Database dump succesfully exported to:
>> backups/local/20140514/15-15-41/db_backup.sql
Importing into Local database
Enter password: 
>> Database imported succesfully
Replacing 'www.deadlys.com.au' with 'deadlys.localhost' in the database

Error: Missing argument, -n or --name is required.
Please enter the missing arguments.
>> Database references succesfully updated.

Operations completed

Done, without errors.

The production database has been pulled down and the local one backed up, but the search replace hasn't happened.

@getdave
Copy link
Owner

getdave commented May 21, 2014

Initial look

This is the param that's missing.

The param is included in the LoDash template which is used by Grunt Deployments (see here)

Your error suggests that the database param isn't being passed into the LoDash template from the task. If we look here we see the database param is passed via the config object.

The config object is in turn supplied to the dbReplace function (see here).

This config in turn comes from here.

Hopefully this breaks things down a little. Are you sure you have the correct options supplied in the task config block in your Gruntfile? Specifically have you provided the database?

I hope that helps a bit.

@davemac
Copy link
Author

davemac commented Jun 5, 2014

Thanks Dave, but yes I have supplied the database as far as I can see.

As I mentioned, it is actually pulling the production database down to my local machine. So the credentials, as far as I know, are OK:

deployments: {
            options: {

            },
            local: {
                "title": "Local",
                "database": "hhmc-new",
                "user": "root",
                "pass": "",
                "host": "localhost",
                "url": "hhmc-new.localhost"
            },
            production: {
                "title": "Production",
                "database": "{I have the database name here}",
                "user": "{I have the database user here}",
                "pass": "{I have the database password here}",
                "host": "{I have my database host URL here}",
                "url": "{I have production URL here}",
                "ssh_user": "{I have my SSH user here}", 
                "ssh_host": "{I have my SSH host here}"
            }
        },

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

No branches or pull requests

2 participants