JN-Jones / web-artisan

A package for Laravel 4 top interact with the CLI
54 stars 11 forks source link

Something went wrong. Probably you entered an invalid command? If it's an error with the package, please let me know. #12

Open JimmyHowe opened 10 years ago

JimmyHowe commented 10 years ago

Trying to run 'artisan migrate' or any other command. Web Artisan is on server and I've put my IP address in the config.

D-side commented 9 years ago

Yep, just got the same. It's probably too late, but solutions better appear late than never.

The issue arises because web artisan issues commands in a non-interactive session: like it creates a session each time a command is run and does not expect any input from the user.

But prodiction environment asks for a confirmation, because this could be a destructive change and cause loss of data. There is apparently a flag -n that forces the system not to ask anything interactive, but it doesn't work, and there is a complaint about lack of STDIN in the logs.

I got this working by using --force flag:

artisan migrate --force

Still, I haven't figured out how to roll back, because this still complains about lack of STDIN:

artisan migrate:rollback --force
JN-Jones commented 9 years ago

Sorry forgot to take a look. Still too busy unfortunately.

But yes, it is likely caused by a missing input channel. Web Artisan uses laravels artisan class which is slightly different than the actual CLI command. I'll need to reset up my workbench before I can take a look so I won't be able to look at it soon.

D-side commented 9 years ago

Got this working. Latest error messages were related to absent migration classes. I did try that classic "update autoload" solution, but that didn't seem to have any effect. Fixed them by running composer update locally and then reuploading the project to webhost.

After that, artisan migrate:rollback --force worked just fine.

I'm still new to Laravel, but I've previously worked with Rails. Things work a bit different here... I really should make a decent "mirror" for development.