Server to server migration fails - Argument #1 ($cpassword) must be of type string, null given

Bug Report Template

Description

Server migration script fails to move a site from one apiscp server to another. Both servers run same version.

Steps to Reproduce

apnscp_php /usr/local/apnscp/bin/scripts/transfersite.php -c=‘dns,provider=null’ --stage=0 --no-suspend -s [server hostname] [domain name]

Expected Behavior

Copy site to new server.

Actual Behavior

Output below has been edited to remove domain and server ids

beginning migration: domain.com (stage 0)
creating site on serverhostname.com
INFO : Overrides detected - replacing values
INFO : Overriding [dns] provider => None

  • different source/dest platform 8.0/8.0
    WARN: /usr/local/sbin/AddDomain --‘output’=‘json’ --‘fd’=‘10’ -c ‘aliases,aliases’=‘’ -c ‘aliases,enabled’=‘0’ -c ‘aliases,max’=‘None’ -c ‘aliases,version’=‘3.2’ -c ‘apache,enabled’=‘1’ -c ‘apache,jail’=‘1’ -c ‘apache,subnum’=‘None’ -c ‘apache,version’=‘3.2’ -c ‘apache,webserver’=‘www.domain.com’ -c ‘apache,webuser’=‘apache’ -c ‘auth,cpasswd’=‘None’ -c ‘auth,enabled’=‘1’ -c ‘auth,iprestrict’=‘50’ -c ‘auth,passwd’=‘None’ -c ‘auth,tpasswd’=‘None’ -c ‘auth,version’=‘3.2’ -c ‘bandwidth,enabled’=‘1’ -c ‘bandwidth,threshold’=‘100’ -c ‘bandwidth,units’=‘GB’ -c ‘bandwidth,version’=‘3.2’ -c ‘billing,addons’=‘None’ -c ‘billing,ctime’=‘1685675823’ -c ‘billing,enabled’=‘1’ -c ‘billing,invoice’=‘apnscp-WGZPXNCS’ -c ‘billing,parent_invoice’=‘None’ -c ‘billing,version’=‘3.2’ -c ‘cgroup,cpu’=‘2000’ -c ‘cgroup,cpupin’=‘None’ -c ‘cgroup,cpuweight’=‘100’ -c ‘cgroup,delegator’=‘None’ -c ‘cgroup,enabled’=‘1’ -c ‘cgroup,io’=‘4096’ -c ‘cgroup,ioweight’=‘100’ -c ‘cgroup,memory’=‘512’ -c ‘cgroup,proclimit’=‘100’ -c ‘cgroup,readbw’=‘100’ -c ‘cgroup,readiops’=‘None’ -c ‘cgroup,version’=‘3.2’ -c ‘cgroup,writebw’=‘100’ -c ‘cgroup,writeiops’=‘None’ -c ‘crontab,enabled’=‘0’ -c ‘crontab,permit’=‘0’ -c ‘crontab,version’=‘3.2’ -c ‘diskquota,amnesty’=‘None’ -c ‘diskquota,enabled’=‘1’ -c ‘diskquota,fquota’=‘None’ -c ‘diskquota,quota’=‘12’ -c ‘diskquota,units’=‘GB’ -c ‘diskquota,version’=‘3.2’ -c ‘dns,enabled’=‘1’ -c ‘dns,key’=‘m9sH3LbL5M7_-7rZVB2rve5p9u88S6CYXFwD1Gbc’ -c ‘dns,provider’=‘None’ -c ‘dns,version’=‘3.2’ -c ‘files,enabled’=‘1’ -c ‘files,fsopt’=‘None’ -c ‘files,mounts’=‘’ -c ‘files,version’=‘3.2’ -c ‘ftp,enabled’=‘1’ -c ‘ftp,ftpserver’=‘ftp.domain.com’ -c ‘ftp,version’=‘3.2’ -c ‘ipinfo,enabled’=‘1’ -c ‘ipinfo,ipaddrs’=‘’ -c ‘ipinfo,namebased’=‘1’ -c ‘ipinfo,version’=‘3.2’ -c ‘ipinfo6,enabled’=‘0’ -c ‘ipinfo6,ipaddrs’=‘’ -c ‘ipinfo6,namebased’=‘1’ -c ‘ipinfo6,version’=‘3.2’ -c ‘logrotate,enabled’=‘1’ -c ‘logrotate,version’=‘3.2’ -c ‘logs,enabled’=‘1’ -c ‘logs,version’=‘3.2’ -c ‘mail,enabled’=‘1’ -c ‘mail,key’=‘None’ -c ‘mail,mailserver’=‘mail.domain.com’ -c ‘mail,preference’=‘10’ -c ‘mail,provider’=‘builtin’ -c ‘mail,smtpserver’=‘mail.domain.com’ -c ‘mail,version’=‘3.2’ -c ‘mail,webmail’=‘’ -c ‘metrics,enabled’=‘1’ -c ‘metrics,version’=‘3.2’ -c ‘mlist,enabled’=‘0’ -c ‘mlist,max’=‘0’ -c ‘mlist,provider’=‘DEFAULT’ -c ‘mlist,version’=‘3.2’ -c ‘mysql,dbaseadmin’=‘domainuser’ -c ‘mysql,dbasenum’=‘None’ -c ‘mysql,dbaseprefix’=‘edge_’ -c ‘mysql,enabled’=‘1’ -c ‘mysql,passwd’=‘None’ -c ‘mysql,version’=‘3.2’ -c ‘pgsql,dbaseadmin’=‘None’ -c ‘pgsql,dbasenum’=‘None’ -c ‘pgsql,dbaseprefix’=‘None’ -c ‘pgsql,enabled’=‘0’ -c ‘pgsql,passwd’=‘None’ -c ‘pgsql,tablespace’=‘None’ -c ‘pgsql,version’=‘3.2’ -c ‘rampart,enabled’=‘1’ -c ‘rampart,max’=‘0’ -c ‘rampart,version’=‘3.2’ -c ‘rampart,whitelist’=‘’ -c ‘reseller,enabled’=‘1’ -c ‘reseller,parent_id’=‘None’ -c ‘reseller,reseller_id’=‘0’ -c ‘reseller,version’=‘3.2’ -c ‘siteinfo,admin’=‘admin67’ -c ‘siteinfo,admin_user’=‘domainuser’ -c ‘siteinfo,domain’=‘domain.com’ -c ‘siteinfo,email’=‘billing@domain2.com’ -c ‘siteinfo,enabled’=‘1’ -c ‘siteinfo,notes.0’=‘’ -c ‘siteinfo,notes.1’=’ -c ‘siteinfo,plan’=‘wp’ -c ‘siteinfo,version’=‘3.2’ -c ‘spamfilter,enabled’=‘1’ -c ‘spamfilter,provider’=‘rspamd’ -c ‘spamfilter,version’=‘3.2’ -c ‘ssh,enabled’=‘0’ -c ‘ssh,jail’=‘1’ -c ‘ssh,port_index’=‘None’ -c ‘ssh,version’=‘3.2’ -c ‘ssl,enabled’=‘1’ -c ‘ssl,version’=‘3.2’ -c ‘tomcat,enabled’=‘0’ -c ‘tomcat,permit’=‘0’ -c ‘tomcat,version’=‘3.2’ -c ‘users,enabled’=‘1’ -c ‘users,max’=‘500’ -c ‘users,version’=‘3.2’ -c ‘vacation,enabled’=‘0’ -c ‘vacation,version’=‘3.2’: NON-ZERO RETURN: 255
    output:
    [{“message”:“no bandwidth rollover date specified, using day of month, 21'","severity":4,"caller":"Opcenter\\Service\\Validator... stderr: INFO : no bandwidth rollover date specified, using day of month, 21’
    ERROR : Event\Manager::fire(): Opcenter\Auth\Shadow::va…
    INFO : no bandwidth rollover date specified, using day of month, 21' ERROR : CLI_Transfer::process(): Event\Manager::fire(): Opcenter\Auth\Shadow::valid_crypted(): Argument #1 ($cpassword) must be of type string, null given, called in /usr/local/apnscp/lib/Opcenter/Service/Validators/Auth/Cpasswd.php on line 35 0. Error_Reporter::merge_buffer([[message:"no bandwidth rollover date specified, using day of month, 21’”, severity:4, caller:“Opcenter\Service\Validators\Bandwidth\Rollover::valid”, bt:null], [[message:“Event\Manager::fire(): Opcenter\Auth\Shadow::valid_crypted(): Argument #1 ($cpassword) must be of type string, null given, called in /usr/local/apnscp/lib/Opcenter/Service/Validators/Auth/Cpasswd.php on line 35”, severity:16, caller:“Event\Manager::fire”, bt:" 0. Error_Reporter::add_error(“Opcenter\Auth\Shadow::valid_crypted(): Argument #1 ($cpassword) must be of type string, null given, called in /usr/local/apnscp/lib/Opcenter/Service/Validators/Auth/Cpasswd.php on line 35”, ) [/usr/local/apnscp/lib/log_wrapper.php:72] 1. error(“Opcenter\Auth\Shadow::valid_crypted(): Argument #1 ($cpassword) must be of type string, null given, called in /usr/local/apnscp/lib/Opcenter/Service/Validators/Auth/Cpasswd.php on line 35”, ) [/usr/local/apnscp/lib/Event/Manager.php:195] 2. Event\Manager->fire(“FILESYSTEM.created”, Opcenter\Filesystem) [/usr/local/apnscp/lib/Event/Cardinal.php:172] 3. Event\Cardinal::fire([“FILESYSTEM”, “created”], Opcenter\Filesystem) [/usr/local/apnscp/lib/Opcenter/Filesystem.php:68] 4. Opcenter\Filesystem->populate() [/usr/local/apnscp/lib/Opcenter/Filesystem.php:46] 5. Opcenter\Filesystem::create(“site62”) [/usr/local/apnscp/lib/Opcenter/Account/Create.php:154] 6. Opcenter\Account\Create->exec() [/usr/local/apnscp/bin/AddDomain:36]"], ]])
    [/usr/local/apnscp/lib/CLI/Transfer.php:397]
    1. CLI_Transfer->_create_site()
    [/usr/local/apnscp/lib/CLI/Transfer.php:142]
    2. CLI_Transfer->process()
    [/usr/local/apnscp/bin/scripts/transfersite.php:233]
    FATAL : fatal(): failed to create account
    0. Error_Reporter::merge_buffer([[message:"no bandwidth rollover date specified, using day of month, 21'", severity:4, caller:"Opcenter\Service\Validators\Bandwidth\Rollover::valid", bt:null], [[message:"Event\Manager::fire(): Opcenter\Auth\Shadow::valid_crypted(): Argument #1 ($cpassword) must be of type string, null given, called in /usr/local/apnscp/lib/Opcenter/Service/Validators/Auth/Cpasswd.php on line 35", severity:16, caller:"Event\Manager::fire", bt:" 0. Error_Reporter::add_error("Opcenter\Auth\Shadow::valid_crypted(): Argument #1 ($cpassword) must be of type string, null given, called in /usr/local/apnscp/lib/Opcenter/Service/Validators/Auth/Cpasswd.php on line 35", []) [/usr/local/apnscp/lib/log_wrapper.php:72] 1. error("Opcenter\Auth\Shadow::valid_crypted(): Argument #1 ($cpassword) must be of type string, null given, called in /usr/local/apnscp/lib/Opcenter/Service/Validators/Auth/Cpasswd.php on line 35", ) [/usr/local/apnscp/lib/Event/Manager.php:195] 2. Event\Manager->fire("FILESYSTEM.created", Opcenter\Filesystem) [/usr/local/apnscp/lib/Event/Cardinal.php:172] 3. Event\Cardinal::fire(["FILESYSTEM", "created"], Opcenter\Filesystem) [/usr/local/apnscp/lib/Opcenter/Filesystem.php:68] 4. Opcenter\Filesystem->populate() [/usr/local/apnscp/lib/Opcenter/Filesystem.php:46] 5. Opcenter\Filesystem::create("site62") [/usr/local/apnscp/lib/Opcenter/Account/Create.php:154] 6. Opcenter\Account\Create->exec() [/usr/local/apnscp/bin/AddDomain:36]"], []]]) [/usr/local/apnscp/lib/CLI/Transfer.php:397] 1. CLI_Transfer->_create_site() [/usr/local/apnscp/lib/CLI/Transfer.php:142] 2. CLI_Transfer->process() [/usr/local/apnscp/bin/scripts/transfersite.php:233] ERROR : CLI_Transfer::_create_site(): unable to add site, aborting! 0. Error_Reporter::add_error("unable to add site, aborting!", ) [/usr/local/apnscp/lib/log_wrapper.php:72] 1. error("unable to add site, aborting!") [/usr/local/apnscp/lib/CLI/Transfer.php:403] 2. CLI_Transfer->_create_site() [/usr/local/apnscp/lib/CLI/Transfer.php:142] 3. CLI_Transfer->process() [/usr/local/apnscp/bin/scripts/transfersite.php:233] Overrides detected - replacing values Overriding [dns] provider => None no bandwidth rollover date specified, using day of month, 21’
    CLI_Transfer::process(): Event\Manager::fire(): Opcenter\Auth\Shadow::valid_crypted(): Argument #1 ($cpassword) must be of type string, null given, called in /usr/local/apnscp/lib/Opcenter/Service/Validators/Auth/Cpasswd.php on line 35
    fatal(): failed to create account
    CLI_Transfer::_create_site(): unable to add site, aborting!

Environment

ApisCP version:
revision: 3ec2e7884c258580fa707cfe827a4269861007c6
timestamp: 1730519492
ver_maj: 3
ver_min: 2
ver_patch: 45
ver_pre: ‘’
dirty: false
debug: false

Operating System: uname -r
3.10.0-1160.108.1.el7.x86_64

On the destination server, hop on edge which should resolve it:

cpcmd scope:set cp.update-policy edge-major
upcp

Destination server:

cpcmd scope:set cp.update-policy edge-major
INFO : Bootstrapper task running in background with roles: apnscp/crons, apnscp/install-services
1

upcp
fatal: No current branch.
Reasserting permissions
storage/tmp/agent-root
storage/opcenter/mappings/domainmap.tch
storage/.edge.lock
storage/run/httpd.pid
storage/run/apnscpd.pid
storage/cache/config.php
storage/.upcp.failure
.git/index
fatal: No current branch.
Compiled services and packages files removed!
Nothing to migrate.
Nothing to migrate.

cpcmd misc:cp-version
revision: 113efab43dc3b6500fab21a6829d57d59a15e128
timestamp: 1728680026
ver_maj: 3
ver_min: 2
ver_patch: 45
ver_pre: 11-g113efab4
dirty: false
debug: false

cd /usr/local/apnscp
git checkout master
git reset --hard

Did that and went back to the source to try again.

CLI_Transfer::_create_site(): unable to add site, aborting!
INFO: Overrides detected - replacing values
INFO: Overriding [dns] provider => None
FATAL: fatal(): unknown configuration value(s) delegator' located in service cgroup’

Run upcp to bring the code current on edge. Local master ref is behind. If that fails, cd /usr/local/apnscp ; git reset --hard origin/master

I did that on both servers and it worked. Thank you for your help!