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

Broken uninstall script #65

Closed
alq666 opened this issue Jun 7, 2012 · 6 comments
Closed

Broken uninstall script #65

alq666 opened this issue Jun 7, 2012 · 6 comments
Assignees
Milestone

Comments

@alq666
Copy link
Member

alq666 commented Jun 7, 2012

Ubuntu 10.04 LTS

# apt-get remove datadog-agent
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
 datadog-agent-lib supervisor python-tornado datadog-agent-base python-meld3 python-medusa python-mysqldb
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
 datadog-agent
0 upgraded, 0 newly installed, 1 to remove and 134 not upgraded.
After this operation, 14.3kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 74611 files and directories currently installed.)
Removing datadog-agent ...
Stopping datadog agent: (using supervisorctl) error: <class 'xmlrpclib.Fault'>, <Fault 10: 'BAD_NAME: datadog-agent'>: file: /usr/lib/python2.6/xmlrpclib.py line: 838
invoke-rc.d: initscript datadog-agent, action "stop" failed.
dpkg: error processing datadog-agent (--remove):
 subprocess installed pre-removal script returned error exit status 2
Errors were encountered while processing:
 datadog-agent
E: Sub-process /usr/bin/dpkg returned an error code (1)
$ sudo apt-get autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 130 not upgraded.
1 not fully installed or removed.
After this operation, 0B of additional disk space will be used.
Setting up datadog-agent (2.2.24-127) ...
No config updates to processes
Stopping datadog agent: (using supervisorctl) error: <class 'xmlrpclib.Fault'>, <Fault 10: 'BAD_NAME: datadog-agent'>: file: /usr/lib/python2.6/xmlrpclib.py line: 838
invoke-rc.d: initscript datadog-agent, action "restart" failed.
dpkg: error processing datadog-agent (--configure):
 subprocess installed post-installation script returned error exit status 2
@ghost ghost assigned alq666 Jun 7, 2012
@alq666
Copy link
Member Author

alq666 commented Jun 7, 2012

Repro

  1. Install agent
  2. Remove or move /etc/dd-agent/supervisor_ddagent.conf away
  3. Restart supervisord
  4. Stop agent with sudo service datadog-agent stop

@alq666
Copy link
Member Author

alq666 commented Jun 7, 2012

Here's a patch to unstuck apt-get:

wget -O - https://raw.github.com/gist/2890110/e44a07a62f787405f23163daf13743231488c98e/datadog-agent.diff 2> /dev/null | sudo patch /etc/init.d/datadog-agent

@alq666 alq666 closed this as completed Jun 11, 2012
@solkennedy
Copy link

Same issue:
Errors were encountered while processing:
datadog-agent-base
E: Sub-process /usr/bin/dpkg returned an error code (1)

Patch does not work anymore.
patching file /etc/init.d/datadog-agent
Hunk #1 FAILED at 54.
1 out of 1 hunk FAILED -- saving rejects to file /etc/init.d/datadog-agent.rej

which contains:
--- datadog-agent.init
+++ datadog-agent.init
@@ -54,8 +54,15 @@

     echo -n "Stopping $DESC: "
     if [ -f $USE_SUPERVISOR ]; then
  •        echo -n "(using supervisorctl) "
    
  •        supervisorctl stop datadog-agent:*
    
  •       # Prevent errors if not under actual supervision
    
  •       supervised=$(supervisorctl avail | grep datadog-agent | wc -l)
    
  •       if [ $supervised -gt 1 ]; then
    
  •           echo -n "(using supervisorctl) "
    
  •           supervisorctl stop datadog-agent:*
    
  •       else
    
  •           # Should have been
    
  •            echo -n "(warning: datadog-agent supervisor config is missing) "
    
  •        fi
     else
         su $AGENTUSER -c "$AGENTPATH stop init"
     fi
    

@solkennedy
Copy link

Was able to solve with:
mv /etc/init.d/datadog-agent.orig /etc/init.d/datadog-agent

@ssbarnea
Copy link

Pleaser reopen this bug, moving the file doesn't solve a product bug, see #1130

@ssbarnea
Copy link

Maybe is different because in my case removing the file didn't solve the problem.

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

No branches or pull requests

3 participants