installed cdrtool package post-installation script subprocess returned error exit status 1

Asked by santosh on 2019-08-23

I am trying to install a package (CDRTOOL) from last 3-4 days but of no success.
evrytime i try to install it , i am stuck here :-

Setting up cdrtool (9.7.0) ...
Job for cdrtool.service failed because the service did not take the steps required by its unit configuration.
See "systemctl status cdrtool.service" and "journalctl -xe" for details.
invoke-rc.d: initscript cdrtool, action "start" failed.
● cdrtool.service - CDR mediation and rating engine for Call Details Records.
   Loaded: loaded (/lib/systemd/system/cdrtool.service; disabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: protocol) since Fri 2019-08-23 10:04:42 IST; 5ms ago
  Process: 4683 ExecStart=/var/www/CDRTool/scripts/ratingEngine.php (code=exited, status=0/SUCCESS)
dpkg: error processing package cdrtool (--configure):
 installed cdrtool package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 cdrtool
E: Sub-process /usr/bin/dpkg returned an error code (1)

thanks in advance

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu pam Edit question
Assignee:
No assignee Edit question
Solved by:
santosh
Solved:
2019-08-26
Last query:
2019-08-26
Last reply:
2019-08-26

https://askubuntu.com/questions/1167596/sub-process-usr-bin-dpkg-returned-an-error-code-1-while-installing-cdrtool-or

Seems to be bug. I suggest you report a bug. You can do this with:

ubuntu-bug cdrtool

santosh (santo407) said : #2

https://launchpad.net/~andrew-woodhead666

is it so ?? using this :- See "systemctl status cdrtool.service" and "journalctl -xe" for details.

when i run :- "journalctl -xe" , the following error I am gettting .......

 Unit cdrtool.service has failed.
--
-- The result is RESULT.
Aug 23 14:44:15 santo-VirtualBox systemd[1]: cdrtool.service: Service hold-off time over, scheduling restart.
Aug 23 14:44:15 santo-VirtualBox systemd[1]: cdrtool.service: Scheduled restart job, restart counter is at 39572.
-- Subject: Automatic restarting of a unit has been scheduled
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Automatic restarting of the unit cdrtool.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.
Aug 23 14:44:15 santo-VirtualBox systemd[1]: Stopped CDR mediation and rating engine for Call Details Records..
-- Subject: Unit cdrtool.service has finished shutting down
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit cdrtool.service has finished shutting down.
Aug 23 14:44:15 santo-VirtualBox systemd[1]: Starting CDR mediation and rating engine for Call Details Records....
-- Subject: Unit cdrtool.service has begun start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit cdrtool.service has begun starting up.
Aug 23 14:44:15 santo-VirtualBox cdrtool[20556]: Starting CDRTool Rating Engine...
Aug 23 14:44:15 santo-VirtualBox cdrtool[20556]: Error in connect(): connect as cdradmin to sipdb failed
Aug 23 14:44:15 santo-VirtualBox ratingEngine.php[20556]: Session halted.
Aug 23 14:44:15 santo-VirtualBox cdrtool[20556]: Database error: connect as cdradmin to sipdb failed.
Aug 23 14:44:15 santo-VirtualBox systemd[1]: cdrtool.service: Can't open PID file /var/run/ratingEngine.pid (yet?) after start: No such file or directory
Aug 23 14:44:15 santo-VirtualBox systemd[1]: cdrtool.service: Failed with result 'protocol'.
Aug 23 14:44:15 santo-VirtualBox systemd[1]: Failed to start CDR mediation and rating engine for Call Details Records..
-- Subject: Unit cdrtool.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit cdrtool.service has failed.
--
-- The result is RESULT.

Manfred Hampl (m-hampl) said : #3

For diagnostic purposes please provide the output that you receive for the commands

uname -a
lsb_release -crid
apt policy cdrtool

The message "Database error: connect as cdradmin to sipdb failed." probably indicates that there is something wrong with the setup of sipdb or the interaction between cdrtool and sipdb.

From which source did you get the cdrtool package?
Maybe you should ask there.

santosh (santo407) said : #4

https://launchpad.net/~m-hampl

Output of " uname -a " :-

Linux santo-VirtualBox 5.0.0-25-generic #26~18.04.1-Ubuntu SMP Thu Aug 1 13:51:02 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Output of lsb_release -crid :-

Distributor ID: Ubuntu
Description: Ubuntu 18.04.3 LTS
Release: 18.04
Codename: bionic

Output of apt policy cdrtool :-

cdrtool:
  Installed: 9.7.0
  Candidate: 9.7.0
  Version table:
 *** 9.7.0 500
        500 http://ag-projects.com/debian unstable/main amd64 Packages
        500 http://ag-projects.com/debian unstable/main i386 Packages
        100 /var/lib/dpkg/status

installed cdrtool from the guidelines provided here :- http://cdrtool.ag-projects.com/installation-guide/

Manfred Hampl (m-hampl) said : #5

Sorry, no idea, probably not an Ubuntu problem.
As already written, I suggest that you look for help at ag-projects and/or openSIPS.

I suggest you contact the maintainer of the repository. Is it made to be used with Ubuntu?

santosh (santo407) said : #7

it can be installed on ubuntu as well , but the installation with debian is simpler because configuration is done by itself.

by the way , this problem has got solved now ... by simply doing this

rm /var/lib/dpkg/info/[package_name].*
dpkg --configure -a
apt-get update

santosh (santo407) said : #8

thank u all for help ..! cheers !

Manfred Hampl (m-hampl) said : #9

I do not think that the action
rm /var/lib/dpkg/info/[package_name].*
was a good idea.
You have (among others) deleted the scripts that care for correct initialization after installing (and pre-removal actions before uninstalling) of that package. I doubt that the package will now be correctly functioning.
I expect that you now will receive the message 'dpkg: warning files list file for package '...' missing, assuming package has no files currently installed.' whenever you do a package install or update.

santosh (santo407) said : #10

till now it's functioning correctly after reinstalling it ( the same package :- cdrtool )
Isn't it so , during installation , all the deleted scripts will again come in picture as it was before .

Manfred Hampl (m-hampl) said : #11

Reinstalling the package will have brought the files back.