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

'is_template' column not found in the where clause. #100

Closed
knvpk opened this issue Sep 20, 2015 · 11 comments
Closed

'is_template' column not found in the where clause. #100

knvpk opened this issue Sep 20, 2015 · 11 comments
Labels

Comments

@knvpk
Copy link
Contributor

knvpk commented Sep 20, 2015

Im getting this error, for first time installing

here is the stack trace from cli log in storage folder

Next exception 'Illuminate\Database\QueryException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'is_template' in 'where clause' (SQL: select count(*) as aggregate from `projects` where `projects`.`deleted_at` is null and `projects`.`group_id` = 1 and `projects`.`group_id` is not null and `is_template` = 0 order by `name` asc)' in /var/www/deployer/vendor/laravel/framework/src/Illuminate/Database/Connection.php:636
Stack trace:
#0 /var/www/deployer/vendor/laravel/framework/src/Illuminate/Database/Connection.php(596): Illuminate\Database\Connection->runQueryCallback('select count(*)...', Array, Object(Closure))
#1 /var/www/deployer/vendor/laravel/framework/src/Illuminate/Database/Connection.php(315): Illuminate\Database\Connection->run('select count(*)...', Array, Object(Closure))
#2 /var/www/deployer/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(1389): Illuminate\Database\Connection->select('select count(*)...', Array, true)
#3 /var/www/deployer/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(1379): Illuminate\Database\Query\Builder->runSelect()
#4 /var/www/deployer/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(1364): Illuminate\Database\Query\Builder->getFresh(Array)
#5 /var/www/deployer/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(1676): Illuminate\Database\Query\Builder->get(Array)
#6 /var/www/deployer/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(1607): Illuminate\Database\Query\Builder->aggregate('count', Array)
#7 [internal function]: Illuminate\Database\Query\Builder->count()
#8 /var/www/deployer/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(943): call_user_func_array(Array, Array)
#9 [internal function]: Illuminate\Database\Eloquent\Builder->__call('count', Array)
#10 [internal function]: Illuminate\Database\Eloquent\Builder->count()
#11 /var/www/deployer/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Relation.php(329): call_user_func_array(Array, Array)
#12 /var/www/deployer/app/Group.php(57): Illuminate\Database\Eloquent\Relations\Relation->__call('count', Array)
#13 /var/www/deployer/app/Group.php(57): Illuminate\Database\Eloquent\Relations\HasMany->count()
#14 /var/www/deployer/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(2722): REBELinBLUE\Deployer\Group->getProjectCountAttribute(NULL)
#15 /var/www/deployer/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(2734): Illuminate\Database\Eloquent\Model->mutateAttribute('project_count', NULL)
#16 /var/www/deployer/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(2494): Illuminate\Database\Eloquent\Model->mutateAttributeForArray('project_count', NULL)
#17 /var/www/deployer/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(2434): Illuminate\Database\Eloquent\Model->attributesToArray()
#18 /var/www/deployer/vendor/laravel/framework/src/Illuminate/Broadcasting/BroadcastEvent.php(82): Illuminate\Database\Eloquent\Model->toArray()
#19 /var/www/deployer/vendor/laravel/framework/src/Illuminate/Broadcasting/BroadcastEvent.php(67): Illuminate\Broadcasting\BroadcastEvent->formatProperty(Object(REBELinBLUE\Deployer\Group))
#20 /var/www/deployer/vendor/laravel/framework/src/Illuminate/Broadcasting/BroadcastEvent.php(46): Illuminate\Broadcasting\BroadcastEvent->getPayloadFromEvent(Object(REBELinBLUE\Deployer\Events\ModelCreated))
#21 /var/www/deployer/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(129): Illuminate\Broadcasting\BroadcastEvent->fire(Object(Illuminate\Queue\Jobs\SyncJob), Array)
#22 /var/www/deployer/vendor/laravel/framework/src/Illuminate/Queue/Jobs/SyncJob.php(44): Illuminate\Queue\Jobs\Job->resolveAndFire(Array)
#23 /var/www/deployer/vendor/laravel/framework/src/Illuminate/Queue/SyncQueue.php(27): Illuminate\Queue\Jobs\SyncJob->fire()
#24 /var/www/deployer/vendor/laravel/framework/src/Illuminate/Queue/Queue.php(33): Illuminate\Queue\SyncQueue->push('Illuminate\\Broa...', Array, NULL)
#25 /var/www/deployer/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(262): Illuminate\Queue\Queue->pushOn(NULL, 'Illuminate\\Broa...', Array)
#26 /var/www/deployer/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(217): Illuminate\Events\Dispatcher->broadcastEvent(Object(REBELinBLUE\Deployer\Events\ModelCreated))
#27 /var/www/deployer/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(705): Illuminate\Events\Dispatcher->fire(Object(REBELinBLUE\Deployer\Events\ModelCreated), Array, false)
#28 /var/www/deployer/app/Traits/BroadcastChanges.php(23): event(Object(REBELinBLUE\Deployer\Events\ModelCreated))
#29 [internal function]: REBELinBLUE\Deployer\Group::REBELinBLUE\Deployer\Traits\{closure}(Object(REBELinBLUE\Deployer\Group))
#30 /var/www/deployer/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(221): call_user_func_array(Object(Closure), Array)
#31 /var/www/deployer/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1692): Illuminate\Events\Dispatcher->fire('eloquent.create...', Object(REBELinBLUE\Deployer\Group))
#32 /var/www/deployer/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1622): Illuminate\Database\Eloquent\Model->fireModelEvent('created', false)
#33 /var/www/deployer/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1511): Illuminate\Database\Eloquent\Model->performInsert(Object(Illuminate\Database\Eloquent\Builder), Array)
#34 /var/www/deployer/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(546): Illuminate\Database\Eloquent\Model->save()
#35 /var/www/deployer/database/migrations/2015_03_16_212800_create_projects_table.php(41): Illuminate\Database\Eloquent\Model::create(Array)
#36 /var/www/deployer/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(135): CreateProjectsTable->up()
#37 /var/www/deployer/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(112): Illuminate\Database\Migrations\Migrator->runUp('2015_03_16_2128...', 1, false)
#38 /var/www/deployer/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(85): Illuminate\Database\Migrations\Migrator->runMigrationList(Array, false)
#39 /var/www/deployer/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(74): Illuminate\Database\Migrations\Migrator->run('/var/www/deploy...', false)
#40 [internal function]: Illuminate\Database\Console\Migrations\MigrateCommand->fire()
#41 /var/www/deployer/vendor/laravel/framework/src/Illuminate/Container/Container.php(502): call_user_func_array(Array, Array)
#42 /var/www/deployer/vendor/laravel/framework/src/Illuminate/Console/Command.php(150): Illuminate\Container\Container->call(Array)
#43 /var/www/deployer/vendor/symfony/console/Command/Command.php(259): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#44 /var/www/deployer/vendor/laravel/framework/src/Illuminate/Console/Command.php(136): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#45 /var/www/deployer/vendor/symfony/console/Application.php(878): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#46 /var/www/deployer/vendor/symfony/console/Application.php(195): Symfony\Component\Console\Application->doRunCommand(Object(Illuminate\Database\Console\Migrations\MigrateCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#47 /var/www/deployer/vendor/symfony/console/Application.php(126): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#48 /var/www/deployer/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(100): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#49 /var/www/deployer/artisan(36): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#50 {main}
@REBELinBLUE
Copy link
Owner

Hmm, odd

Have you run php artisan migrate to make sure you are up to date? Also, can you check the migrations table and see if 2015_06_16_213224_add_is_template_column.php has been run?

@knvpk
Copy link
Contributor Author

knvpk commented Sep 21, 2015

Some query is executing before actually the 2015_06_16_213224_add_is_template_column.php migration runs, from trace log it is firing the model creating event. rest all are up to date.

@knvpk
Copy link
Contributor Author

knvpk commented Sep 21, 2015

Hi, i cleared this error by just commenting the group creation in one migration file, but now im getting this error when deploying the project, There was an error retrieving the repository information, please check that the URL is correct and that the SSH key has been added as the code is from aws code commit, i think there is no way to add a ssh to thier servers. what can i do?

@REBELinBLUE
Copy link
Owner

I've never used code commit, will have to try signing up for an account but I found this http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_ssh-keys.html

http://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-without-cli.html

I am having issues recreating this. What database system are you using?

Could you post the content of .env obviously hiding the value of APP_KEY and the DB login details

@REBELinBLUE
Copy link
Owner

@knvpk
Copy link
Contributor Author

knvpk commented Sep 22, 2015

APP_ENV=local
APP_DEBUG=true
APP_KEY=SomeRandomString
APP_URL=http://deploy.app
APP_TIMEZONE=Europe/London

DB_TYPE=mysql
DB_HOST=localhost
DB_DATABASE=deployer
DB_USERNAME=
DB_PASSWORD=

CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
BROADCAST_DRIVER=log

SOCKET_URL=http://deploy.app

MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_FROM_ADDRESS=null
MAIL_FROM_NAME=null

This is my env.

@knvpk
Copy link
Contributor Author

knvpk commented Sep 22, 2015

Yeah , above mentioned branch is working perfectly.

@REBELinBLUE
Copy link
Owner

Thanks.

I am guessing it is having the BROADCAST_DRIVER set to log which causes it because it means the broadcast event will happen immediately before the migrations have finished so the column doesn't exist.

Since that branch fixes it I will merge it

@REBELinBLUE
Copy link
Owner

By the way, you should probably run php artisan key:generate if that is really what APP_KEY is set to ;)

@knvpk
Copy link
Contributor Author

knvpk commented Sep 23, 2015

I just written that SomeRandomString, actually im using a different key. thanks for fixing.

@REBELinBLUE
Copy link
Owner

Ah, just wanted to check

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

No branches or pull requests

2 participants