putyourlightson / craft-campaign

Send and manage email campaigns, contacts and mailing lists in Craft CMS.
https://putyourlightson.com/plugins/campaign
Other
63 stars 25 forks source link

Import of user group into Contacts fails #16

Closed jcdarwin closed 6 years ago

jcdarwin commented 6 years ago

Importing a user group into contacts fails with the following stack trace.

I notice that ImportJob::import is not defined (e.g. public const $import) in the ImportJob class -- should it be?

2018-09-11 21:54:42 [222.153.247.24][1][1nueujok7rpr95p3obm3la0q8a][error][yii\base\UnknownPropertyException] yii\base\UnknownPropertyException: Setting unknown property: putyourlightson\campaign\jobs\ImportJob::import in /var/www/chinacapable/releases/20180909092740/chinacapable/craft/vendor/yiisoft/yii2/base/BaseObject.php:163
Stack trace:
#0 /var/www/chinacapable/releases/20180909092740/chinacapable/craft/vendor/yiisoft/yii2/BaseYii.php(546): yii\base\BaseObject->__set('import', Object(putyourlightson\campaign\models\ImportModel))
#1 /var/www/chinacapable/releases/20180909092740/chinacapable/craft/vendor/yiisoft/yii2/base/BaseObject.php(107): yii\BaseYii::configure(Object(putyourlightson\campaign\jobs\ImportJob), Array)
#2 /var/www/chinacapable/releases/20180909092740/chinacapable/craft/vendor/putyourlightson/craft-campaign/src/services/ImportsService.php(249): yii\base\BaseObject->__construct(Array)
#3 /var/www/chinacapable/releases/20180909092740/chinacapable/craft/vendor/putyourlightson/craft-campaign/src/controllers/ImportsController.php(209): putyourlightson\campaign\services\ImportsService->queueImport(Object(putyourlightson\campaign\models\ImportModel))
#4 [internal function]: putyourlightson\campaign\controllers\ImportsController->actionImportUserGroup()
#5 /var/www/chinacapable/releases/20180909092740/chinacapable/craft/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#6 /var/www/chinacapable/releases/20180909092740/chinacapable/craft/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#7 /var/www/chinacapable/releases/20180909092740/chinacapable/craft/vendor/craftcms/cms/src/web/Controller.php(103): yii\base\Controller->runAction('import-user-gro...', Array)
#8 /var/www/chinacapable/releases/20180909092740/chinacapable/craft/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('import-user-gro...', Array)
#9 /var/www/chinacapable/releases/20180909092740/chinacapable/craft/vendor/craftcms/cms/src/web/Application.php(282): yii\base\Module->runAction('campaign/import...', Array)
#10 /var/www/chinacapable/releases/20180909092740/chinacapable/craft/vendor/craftcms/cms/src/web/Application.php(538): craft\web\Application->runAction('campaign/import...', Array)
#11 /var/www/chinacapable/releases/20180909092740/chinacapable/craft/vendor/craftcms/cms/src/web/Application.php(266): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#12 /var/www/chinacapable/releases/20180909092740/chinacapable/craft/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#13 /var/www/chinacapable/releases/20180909092740/chinacapable/craft/web/index.php(21): yii\base\Application->run()
#14 {main}
2018-09-11 21:54:42 [222.153.247.24][1][1nueujok7rpr95p3obm3la0q8a][info][application] $_GET = [
    'p' => '/admin/campaign/contacts/import'
]

$_POST = [
    'CRAFT_CSRF_TOKEN' => '••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••'
    'action' => 'campaign/imports/import-user-group'
    'userGroupId' => '2'
    'mailingListId' => [
        0 => '4026'
    ]
    'emailFieldIndex' => 'email'
    'fieldIndexes' => [
        'firstName' => 'firstName'
        'lastName' => 'lastName'
    ]
]

$_FILES = []

$_COOKIE = [
    '1031b8c41dfff97a311a7ac99863bdc5_username' => '9d2c1dfb118c506c9071463a3f2fae7f94c36ec8b6ca0ad5b37fb5c05b1b8697a:2:{i:0;s:41:\"1031b8c41dfff97a311a7ac99863bdc5_username\";i:1;s:25:\"mebooks.support@gmail.com\";}'
    '__stripe_mid' => '3693b89c-3413-4e53-94f9-a70d03de7375'
    '_ga' => 'GA1.4.567533578.1525683764'
    'certificate' => '4927e14279b33b8a8451ef371b0baccd6942a475938ebf1149b72bb464aba988a:2:{i:0;s:11:\"certificate\";i:1;s:92:\"8f77b26c6148a736d353b7b434f821ad64607c371b13e9f6dca3ac2732a8c100czoxMToiY2VydGlmaWNhdGUiOw==\";}'
    '_gid' => 'GA1.3.21740765.1536652985'
    'CraftSessionId' => '1nueujok7rpr95p3obm3la0q8a'
    '1031b8c41dfff97a311a7ac99863bdc5_identity' => 'd63b6768b9b129a05205a3b054aead87633129d40f6fa43bb09a9b687728916ca:2:{i:0;s:41:\"1031b8c41dfff97a311a7ac99863bdc5_identity\";i:1;s:286:\"[\"1\",\"[\\\"SAzxccnBcYJsaXWsnedPf3QeXNfEl5WI58fENzq2k3tlCRUbp0JxlCyjvth4zC4Wko4VzC4uJVgk5qjzNYmS0Kv0p-UDQsB2BRs0\\\",\\\"fabfe36d-841c-4b34-b7fc-2c8eda080dd2\\\",\\\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36\\\"]\",3600]\";}'
    'CRAFT_CSRF_TOKEN' => '•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••'
]

$_SESSION = [
    'bd62416aa8538ede709019a5e113eea5__flash' => []
    '1031b8c41dfff97a311a7ac99863bdc5__id' => '1'
    '1031b8c41dfff97a311a7ac99863bdc5__expire' => 1536663282
]

$_SERVER = [
    'HOSTNAME' => '7e4b02fd7ef7'
    'DB_SERVER' => 'mariadb'
    'DB_PORT' => '3306'
    'PGPASSWORD' => 'welcome'
    'SUPERVISOR_GROUP_NAME' => 'php-fpm7'
    'PATH' => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
    'HOME' => '/nonexistent'
    'LANG' => 'C.UTF-8'
    'SUPERVISOR_SERVER_URL' => 'unix:///tmp/supervisor.sock'
    'DB_DATABASE' => 'chinacapable'
    'SHLVL' => '1'
    'SUPERVISOR_ENABLED' => '1'
    'DB_USER' => 'administrator'
    'DB_PASSWORD' => '•••••••'
    'NGINX_VERSION' => '1.13.12-1~stretch'
    'php_conf' => '/etc/php/7.2/fpm/php.ini'
    'fpm_conf' => '/etc/php/7.2/fpm/pool.d/www.conf'
    'DEBIAN_FRONTEND' => 'noninteractive'
    'DB_DRIVER' => 'mysql'
    'REDIS_HOST' => 'redis'
    'SUPERVISOR_PROCESS_NAME' => 'php-fpm7'
    'REDIS_PORT' => 'tcp://redis:6379'
    'DB_SCHEMA' => 'public'
    '_' => '/usr/local/bin/supervisord'
    'COMPOSER_VERSION' => '1.6.5'
    'PWD' => '/'
    'USER' => 'nginx'
    'HTTP_X_REAL_IP' => '222.153.247.24'
    'HTTP_X_FORWARDED_SERVER' => 'f63ace29d855'
    'HTTP_X_FORWARDED_PROTO' => 'https'
    'HTTP_X_FORWARDED_PORT' => '443'
    'HTTP_X_FORWARDED_HOST' => 'upgrade.chinacapable.org.nz'
    'HTTP_X_FORWARDED_FOR' => '222.153.247.24'
    'HTTP_UPGRADE_INSECURE_REQUESTS' => '1'
    'HTTP_REFERER' => 'https://upgrade.chinacapable.org.nz/admin/campaign/contacts/import'
    'HTTP_ORIGIN' => 'https://upgrade.chinacapable.org.nz'
    'HTTP_DNT' => '1'
    'HTTP_COOKIE' => '1031b8c41dfff97a311a7ac99863bdc5_username=9d2c1dfb118c506c9071463a3f2fae7f94c36ec8b6ca0ad5b37fb5c05b1b8697a%3A2%3A%7Bi%3A0%3Bs%3A41%3A%221031b8c41dfff97a311a7ac99863bdc5_username%22%3Bi%3A1%3Bs%3A25%3A%22mebooks.support%40gmail.com%22%3B%7D; __stripe_mid=3693b89c-3413-4e53-94f9-a70d03de7375; _ga=GA1.4.567533578.1525683764; _ga=GA1.3.2039417849.1535863625; certificate=4927e14279b33b8a8451ef371b0baccd6942a475938ebf1149b72bb464aba988a%3A2%3A%7Bi%3A0%3Bs%3A11%3A%22certificate%22%3Bi%3A1%3Bs%3A92%3A%228f77b26c6148a736d353b7b434f821ad64607c371b13e9f6dca3ac2732a8c100czoxMToiY2VydGlmaWNhdGUiOw%3D%3D%22%3B%7D; _gid=GA1.3.21740765.1536652985; CraftSessionId=1nueujok7rpr95p3obm3la0q8a; 1031b8c41dfff97a311a7ac99863bdc5_identity=d63b6768b9b129a05205a3b054aead87633129d40f6fa43bb09a9b687728916ca%3A2%3A%7Bi%3A0%3Bs%3A41%3A%221031b8c41dfff97a311a7ac99863bdc5_identity%22%3Bi%3A1%3Bs%3A286%3A%22%5B%221%22%2C%22%5B%5C%22SAzxccnBcYJsaXWsnedPf3QeXNfEl5WI58fENzq2k3tlCRUbp0JxlCyjvth4zC4Wko4VzC4uJVgk5qjzNYmS0Kv0p-UDQsB2BRs0%5C%22%2C%5C%22fabfe36d-841c-4b34-b7fc-2c8eda080dd2%5C%22%2C%5C%22Mozilla%2F5.0+%28Macintosh%3B+Intel+Mac+OS+X+10_13_6%29+AppleWebKit%2F537.36+%28KHTML%2C+like+Gecko%29+Chrome%2F68.0.3440.106+Safari%2F537.36%5C%22%5D%22%2C3600%5D%22%3B%7D; CRAFT_CSRF_TOKEN=37e974fe7da5002dec712d5cbc04226c6a2400b021413da3ab52fde8547eca78a%3A2%3A%7Bi%3A0%3Bs%3A16%3A%22CRAFT_CSRF_TOKEN%22%3Bi%3A1%3Bs%3A208%3A%22gVVCCNcZ9_sWpUivcT5RKPUCPL_CeFY6BVFbLWR1%7Cc9d5794bfc58c663c077e51c07875614c94971e459d7eaccfac18f49fc861741gVVCCNcZ9_sWpUivcT5RKPUCPL_CeFY6BVFbLWR1%7C1%7C%242y%2413%24r1YTq%2FWqvIuDQvIxwfvaC.YLPUSEedDsDlllSWZTOzjzjEu8cnUt.%22%3B%7D'
    'HTTP_CONTENT_TYPE' => 'application/x-www-form-urlencoded'
    'HTTP_CACHE_CONTROL' => 'max-age=0'
    'HTTP_AUTHORIZATION' => 'Basic YWRtaW5pc3RyYXRvcjpjaGluYWNhcGFibGU='
    'HTTP_ACCEPT_LANGUAGE' => 'en-US,en;q=0.9'
    'HTTP_ACCEPT_ENCODING' => 'gzip, deflate, br'
    'HTTP_ACCEPT' => 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8'
    'HTTP_CONTENT_LENGTH' => '771'
    'HTTP_USER_AGENT' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36'
    'HTTP_HOST' => 'upgrade.chinacapable.org.nz'
    'PATH_INFO' => ''
    'SCRIPT_FILENAME' => '/var/www/chinacapable/current/./chinacapable/craft/web/index.php'
    'REDIRECT_STATUS' => '200'
    'SERVER_NAME' => '_'
    'SERVER_PORT' => '80'
    'SERVER_ADDR' => '172.18.0.6'
    'REMOTE_PORT' => '33014'
    'REMOTE_ADDR' => '172.18.0.2'
    'SERVER_SOFTWARE' => 'nginx/1.13.12'
    'GATEWAY_INTERFACE' => 'CGI/1.1'
    'REQUEST_SCHEME' => 'http'
    'SERVER_PROTOCOL' => 'HTTP/1.1'
    'DOCUMENT_ROOT' => '/var/www/chinacapable/current/./chinacapable/craft/web'
    'DOCUMENT_URI' => '/index.php'
    'REQUEST_URI' => '/admin/campaign/contacts/import'
    'SCRIPT_NAME' => '/index.php'
    'CONTENT_LENGTH' => '771'
    'CONTENT_TYPE' => 'application/x-www-form-urlencoded'
    'REQUEST_METHOD' => 'POST'
    'QUERY_STRING' => 'p=/admin/campaign/contacts/import&'
    'FCGI_ROLE' => 'RESPONDER'
    'PHP_SELF' => ''
    'PHP_AUTH_USER' => 'administrator'
    'PHP_AUTH_PW' => '••••••••••••'
    'REQUEST_TIME_FLOAT' => 1536659682.2007
    'REQUEST_TIME' => 1536659682
    'DOMAIN' => 'upgrade.chinacapable.org.nz'
    'VOLUMES_PREFIX' => './volumes'
    'VOLUMES_PREFIX_SITE' => '/var/www/chinacapable/'
    'VOLUMES_PREFIX_SITE_CURRENT' => '/var/www/chinacapable/current/'
    'VOLUMES_PREFIX_SITE_SHARED' => '/var/www/chinacapable/shared/'
    'EMAIL' => 'mebooks.support@gmail.com'
    'BASIC_AUTH_USERNAME' => 'administrator'
    'BASIC_AUTH_PASSWORD' => '••••••••••••'
    'BASIC_AUTH_PASSWORD_ENCRYPTED' => '••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••'
    'TARGET' => 'chinacapable'
    'REPO' => 'git@bitbucket.org:nzmebooks/chinacapable.git'
    'BRANCH' => 'craft3'
    'BRANCH_STAGING' => 'feature/email-manager'
    'LOCAL' => 'localhost.chinacapable.org.nz'
    'LOCAL_SCHEME' => 'https://'
    'STAGING' => 'staging.chinacapable.org.nz'
    'PRODUCTION' => 'upgrade.chinacapable.org.nz'
    'DEPLOY_USERNAME' => 'deploy'
    'PRIVATE_KEY' => '••••••••••••••••••••••••••••••'
    'SOCKET' => '/var/run/docker.sock'
    'OWNER_AND_GROUP' => '101:wheel'
    'CRAFT_ENVIRONMENT' => 'production'
    'SECURITY_KEY' => '••••••••••••'
    'DB_TABLE_PREFIX' => ''
]
putyourlightson commented 6 years ago

Thank you for reporting this. Please update to 1.2.5 and try again. Note that you may have to delete the failed job if it is stuck.

jcdarwin commented 6 years ago

Great -- yep, have upgraded and it all looks good -- I could import the user group successfully.

Note that I did strike two other related issues which I've worked around:

putyourlightson commented 6 years ago

Excellent!!