autopkg / recipes

Recipes for AutoPkg
231 stars 204 forks source link

AdobeReaderURLProvider providing invalid URL #426

Closed loganbray closed 2 years ago

loganbray commented 2 years ago

Describe the problem When running the AdobeReaderURL Provider, the provider receives a URL that returns an error on Adobe's site:

An error occurred while processing your request.
Reference #[reference ID]

Preferences contents

{
    "API_PASSWORD" = [password];
    "API_USERNAME" = [username];
    "GIT_PATH" = "/usr/local/git/bin/git";
    "JSS_REPOS" =     (
                {
            type = CDP;
        }
    );
    "JSS_URL" = "[url]";
    "JSS_VERIFY_SSL" = 1;
    "RECIPE_REPOS" =     {
        "/Users/[username]/Library/AutoPkg/RecipeRepos/com.github.autopkg.eholtam-recipes" =         {
            URL = "https://github.com/autopkg/eholtam-recipes.git";
        };
        "/Users/[username]/Library/AutoPkg/RecipeRepos/com.github.autopkg.grahampugh-recipes" =         {
            URL = "https://github.com/autopkg/grahampugh-recipes.git";
        };
        "/Users/[username]/Library/AutoPkg/RecipeRepos/com.github.autopkg.hansen-m-recipes" =         {
            URL = "https://github.com/autopkg/hansen-m-recipes.git";
        };
        "/Users/[username]/Library/AutoPkg/RecipeRepos/com.github.autopkg.homebysix-recipes" =         {
            URL = "https://github.com/autopkg/homebysix-recipes.git";
        };
        "/Users/[username]/Library/AutoPkg/RecipeRepos/com.github.autopkg.jss-recipes" =         {
            URL = "https://github.com/autopkg/jss-recipes.git";
        };
        "/Users/[username]/Library/AutoPkg/RecipeRepos/com.github.autopkg.novaksam-recipes" =         {
            URL = "https://github.com/autopkg/novaksam-recipes.git";
        };
        "/Users/[username]/Library/AutoPkg/RecipeRepos/com.github.autopkg.precursorca-recipes" =         {
            URL = "https://github.com/autopkg/precursorca-recipes.git";
        };
        "/Users/[username]/Library/AutoPkg/RecipeRepos/com.github.autopkg.recipes" =         {
            URL = "https://github.com/autopkg/recipes";
        };
        "/Users/[username]/Library/AutoPkg/RecipeRepos/com.github.autopkg.rtrouton-recipes" =         {
            URL = "https://github.com/autopkg/rtrouton-recipes.git";
        };
        "/Users/[username]/Library/AutoPkg/RecipeRepos/[internal gitlab]" =         {
            URL = "[internal gitlab]";
        };
    };
    "RECIPE_SEARCH_DIRS" =     (
        ".",
        "~/Library/AutoPkg/Recipes",
        "/Library/AutoPkg/Recipes",
        "/Users/[username]/Library/AutoPkg/RecipeRepos/com.github.autopkg.eholtam-recipes",
        "/Users/[username]/Library/AutoPkg/RecipeRepos/com.github.autopkg.recipes",
        "/Users/[username]/Library/AutoPkg/RecipeRepos/com.github.autopkg.homebysix-recipes",
        "/Users/[username]/Library/AutoPkg/RecipeRepos/com.github.autopkg.jss-recipes",
        "/Users/[username]/Library/AutoPkg/RecipeRepos/com.github.autopkg.novaksam-recipes",
        "/Users/[username]/Library/AutoPkg/RecipeRepos/com.github.autopkg.rtrouton-recipes",
        "/Users/[username]/Library/AutoPkg/RecipeRepos/com.github.autopkg.precursorca-recipes",
        "/Users/[username]/Library/AutoPkg/RecipeRepos/edu.utsa.it.armory.endpoint.JAMF.autopkg-recipes",
        "/Users/[username]/Library/AutoPkg/RecipeRepos/com.github.autopkg.grahampugh-recipes",
        "/Users/[username]/Library/AutoPkg/RecipeRepos/com.github.autopkg.hansen-m-recipes"
    );
    "VIRUSTOTAL_ALWAYS_REPORT" = 0;
    "VIRUSTOTAL_AUTO_SUBMIT" = 0;
    "VIRUSTOTAL_AUTO_SUBMIT_MAX_SIZE" = 419430400;
    "VIRUSTOTAL_SLEEP_SECONDS" = 15;
}

AutoPkg output

autopkg-server:~ $ autopkg run -v AdobeReaderDC.download
Processing AdobeReaderDC.download...
WARNING: AdobeReaderDC.download is missing trust info and FAIL_RECIPES_WITHOUT_TRUST_INFO is not set. Proceeding...
AdobeReaderURLProvider
AdobeReaderURLProvider: Found URL https://ardownload.adobe.com/pub/adobe/reader/mac/AcrobatDC/2200120112/AcroRdrDC_2200120112_MUI.dmg
AdobeReaderURLProvider: Found version 22.001.20112
URLDownloader
Command '['/usr/bin/curl', '--silent', '--show-error', '--no-buffer', '--dump-header', '-', '--speed-time', '30', '--location', '--url', 'https://ardownload.adobe.com/pub/adobe/reader/mac/AcrobatDC/2200120112/AcroRdrDC_2200120112_MUI.dmg', '--fail', '--output', '/Users/[username]/Library/AutoPkg/Cache/com.github.autopkg.download.AdobeReaderDC/downloads/tmpmcak05c2']' returned non-zero exit status 22.
Failed.
Receipt written to /Users/[username]/Library/AutoPkg/Cache/com.github.autopkg.download.AdobeReaderDC/receipts/AdobeReaderDC-receipt-20220425-123407.plist

The following recipes failed:
    AdobeReaderDC.download
        Error in com.github.autopkg.download.AdobeReaderDC: Processor: URLDownloader: Error: Command '['/usr/bin/curl', '--silent', '--show-error', '--no-buffer', '--dump-header', '-', '--speed-time', '30', '--location', '--url', 'https://ardownload.adobe.com/pub/adobe/reader/mac/AcrobatDC/2200120112/AcroRdrDC_2200120112_MUI.dmg', '--fail', '--output', '/Users/[username]/Library/AutoPkg/Cache/com.github.autopkg.download.AdobeReaderDC/downloads/tmpmcak05c2']' returned non-zero exit status 22.

Nothing downloaded, packaged or imported.

Expected behavior Expected to provide a usable download link. For example: https://ardownload2.adobe.com/pub/adobe/reader/mac/AcrobatDC/2200120112/AcroRdrDC_2200120112_MUI.dmg

If provided with ardownload2 as the subdomain, the link is fully functional, but throws an error if provided with ardownload as the subdomain for the download URL.

Version (please complete the following information):

homebysix commented 2 years ago

This seems like a duplicate of #424. We've established that the subdomain fix needs to happen in Adobe's hosted JSON file.

gregneagle commented 2 years ago

Since it's been almost a month with no resolution from Adobe, perhaps we need to explore alternate ways to get the download URL.

gregneagle commented 2 years ago

~Perhaps we scrape https://get.adobe.com/reader/~

Driven by too much JavaScript :-(

gregneagle commented 2 years ago

Looks like this https://github.com/autopkg/novaksam-recipes/blob/master/Processors/AdobeAcrobatReaderDcUpdateInfoProvider.py is probably the best approach right now.

timnottom commented 2 years ago

I've tried the download recipe from novaksam , and changed the URL for the processor from https://ardownload2.adobe.com/pub/adobe/reader/mac/%s/%s/%sUpd%s_MUI.dmg to https://ardownload2.adobe.com/pub/adobe/reader/mac/%s/%s/%s_%s_MUI.dmg as mentioned in Slack.

This downloads the latest version but it gives a version of 2200120112 which is not the right input to use to check the version number installed (I use a smart group in Jamf-upload recipe with a regex processor).

The AdobeReaderURLProvider from this repository did always give the right kind of version 22.001.20112.

Is it possible to use the "new" downloadURL with AdobeReaderURLProvider so we can have the right version (with the dots in between)?

Or should I maybe do this some other way?

Thanks! Tim

n8felton commented 2 years ago

I'm going to dedicate some time to resolving this, but is there a preference on updating this repos's AdobeReaderURLProvider or switching the recipes to use novaksam's AdobeAcrobatReaderDcUpdateInfoProvider?

homebysix commented 2 years ago

I'd prefer to fix this repo's recipe.

I was tinkering with making a HEAD request to the download URL within the AdobeReaderURLProvider processor, and swapping ardownload out for ardownload2 if the former returns a 503 error. Never committed the code to a branch though.