Can I get dpkg to ignore an error returned from a post-installation script?

538

You can edit the post install script at /var/lib/dpkg/info/astah-community.postinst to comment out a portion that is failing. Or you can just rename/remove that file to prevent dpkg from running it at all.

Once you've done one of those you can use dpkg --configure astah-community to have dpkg retry the configuration process, and hopefully have that succeed.

Share:
538

Related videos on Youtube

Jason Grein
Author by

Jason Grein

Updated on September 18, 2022

Comments

  • Jason Grein
    Jason Grein over 1 year

    I'm trying to create a Puppeteer function in GCP which can be triggered by Pub/Sub messages. The function is callable, but doesn't behave as expected and throws a Timeout Error once browser tries to initialize. Could the trigger possibly be using a NodeJS environment different from HTTP trigger?

    I'm also very new to NodeJS, so I apologize ahead of time if the issue is blatantly obvious.

    I've created an HTTP trigger for the function which behaves as expected. I copy/paste the Puppeteer Function below into the index.js when creating the Cloud Function, but separated in example for clarity that both triggers are running the identical function.

    Puppeteer Function

    const puppeteer = require('puppeteer');
    
    scrapeUglyWebsite = () => {
        return new Promise(async(resolve, reject) => {
            await puppeteer.launch({
                headless: true,
                args: ['--no-sandbox']
            })
                .then(async (browser) => {
                    const page = await browser.newPage();
                    await page.goto('http://suzannecollinsbooks.com/', {waitUntil: 'load', timeout: 0})
                        .then(async () => {
                            //Wait for content to load
                            await page.waitForFunction('document.body !== null && document.body.innerText.includes(\'Jon Scieszka\')');
                            //Evaluate page contents
                            const dom_eval = await page.evaluate(() => document.body.innerText.includes("Here’s a picture of me with a rat"));
                            await browser.close();
                            resolve(dom_eval);
                        });
                }).catch((err) => {
                    reject(err);
                });
        });
    };
    

    HTTP Trigger - index.js

    exports.cloudFunctionTest = (req, res) => {
        scrapeUglyWebsite()
            .then((results) => {
                if(results) {
                    res.send('Suzanne Collins takes pictures with rats.');
                } else {
                    res.send("Suzzane Collins doesn't take pictures with rats.");
                };
            })
            .catch((err) => {
                res.send(err.toString());
            });
    

    Pub/Sub Trgger - index.js

    exports.cloudFunctionTest = (data, context) => {
        scrapeUglyWebsite()
            .then((results) => {
                if(results) {
                    console.log('Suzanne Collins takes pictures with rats.');
                } else {
                    console.log("Suzzane Collins doesn't take pictures with rats.");
                };
            })
            .catch((err) => {
                console.log(err.toString());
            });
    };
    

    package.json

    {
      "name": "test",
      "version": "0.0.1",
      "engines": {
        "node": "8"
      },
      "dependencies": {
        "puppeteer": "^1.6.0"
      }
    }
    

    HTTP Trigger behaves correctly with the expected result

    Suzanne Collins takes pictures with rats.
    

    Pub/Sub Trigger throws the following error with no output

    TimeoutError: Timed out after 30000 ms while trying to connect to Chrome! The only Chrome revision guaranteed to work is r662092
    
  • wool.in.silver
    wool.in.silver about 11 years
    Yes, that worked! Thankyou.
  • soger
    soger about 8 years
    Thanks, worked for me too, just don't try to do it with aptitude, for some reason it keeps replacing my edited postinst script. But apt-get worked for me.
  • Sanjay Vamja
    Sanjay Vamja over 3 years
  • Elvis Ciotti
    Elvis Ciotti almost 3 years
    Worked to remove mysql-server failing on ubuntu 20. thanks. /var/lib/dpkg/info/mysql-server-*