GithubHelp home page GithubHelp logo

Comments (15)

notverypc avatar notverypc commented on May 20, 2024

What happens if you change the command from:

autopkg run -vvv Skype.munki --post="com.github.notverypc.autopkg-recipes.postprocessors/SlackPostCurl" --key "webhook_url"="https://hooks.slack.com/services/123456789/123456789/123456789"

To, without the "" around webhook_url:

autopkg run -vvv Skype.munki --post="com.github.notverypc.autopkg-recipes.postprocessors/SlackPostCurl" --key webhook_url="https://hooks.slack.com/services/123456789/123456789/123456789"

from autopkg-recipes.

ggeerraalldd avatar ggeerraalldd commented on May 20, 2024

Changing the quoting made no difference.

from autopkg-recipes.

notverypc avatar notverypc commented on May 20, 2024

🤔 Can you add the channel key to the command - even if you're not overriding it.

autopkg run -Skype.munki -post="com.github.notverypc.autopkg-recipes.postprocessors/SlackPostCurl" --key webhook_url="https://hooks.slack.com/services/XXXXXXX" --key slack_channel="testing"

from autopkg-recipes.

ggeerraalldd avatar ggeerraalldd commented on May 20, 2024

Same error, but it did not post to Slack (no 'testing' channel)
The webhook_url I use points directly to my user in Slack.

           'slack_channel': 'testing',
           'webhook_url': 'https://hooks.slack.com/services/123456789/123456789/123456789'}}
SlackPostCurl: No value supplied for slack_icon_url, setting default value of: 
SlackPostCurl: No value supplied for slack_username, setting default value of: AutoPKG
SlackPostCurl: Slack webhook post attempt 1
Traceback (most recent call last):
  File "/Library/AutoPkg/autopkglib/__init__.py", line 1016, in process
    self.env = processor.process()
  File "/Library/AutoPkg/autopkglib/__init__.py", line 802, in process
    self.main()
  File "/Users/shorty/Library/AutoPkg/RecipeRepos/com.github.notverypc.autopkg-recipes/PostProcessors/SlackPostCurl.py", line 145, in main
    ) = self.execute_curl(curl_cmd)
ValueError: too many values to unpack (expected 2)
  File "/Library/AutoPkg/autopkglib/__init__.py", line 1016, in process
    self.env = processor.process()
too many values to unpack (expected 2)
Failed.
Receipt written to /Users/shorty/Library/AutoPkg/Cache/local.munki.Skype/receipts/Skype-receipt-20220902-083227.plist```

from autopkg-recipes.

notverypc avatar notverypc commented on May 20, 2024

Can you post the command you used and I'll look into it further.
"The webhook_url I use points directly to my user in Slack." Are you posting direct to you not a channel?

from autopkg-recipes.

ggeerraalldd avatar ggeerraalldd commented on May 20, 2024

autopkg run -vvv Skype.munki --post="com.github.notverypc.autopkg-recipes.postprocessors/SlackPostCurl" --key webhook_url="https://hooks.slack.com/services/123456789/123456789/123456789" --key slack_channel="testing"

I am posting directly to myself and not a channel. I've used that webhook_url with AutoPkgr and your original Slacker post processor (which still works).

from autopkg-recipes.

notverypc avatar notverypc commented on May 20, 2024

Thanks - I'll have a look into this.
I managed to reproduce the error when I just used the webhook_url but after adding slack_channel it ran without errors.

I'll have a proper dig, probs something simple that I've missed.

from autopkg-recipes.

ggeerraalldd avatar ggeerraalldd commented on May 20, 2024

I went in to Slack settings and changed my webhook URL from a deprecated Custom Integration I set up in 2018 to one generated by the more recent Slack App method. That also made no difference.

from autopkg-recipes.

notverypc avatar notverypc commented on May 20, 2024

I've updated the postprocessor and it should resolve your issue 🤞

from autopkg-recipes.

ggeerraalldd avatar ggeerraalldd commented on May 20, 2024

I think that's closer, but I'm still getting an error. This time, it appears the error is for every recipe that doesn't have an update, so doesn't post to slack:

local variable 'json_data' referenced before assignment
Failed.

From a AutoPkg list of 61 recipes, 2 had updates and I received the error 59 times. That includes MakeCatalogs.munki recipe that runs at the end, and will never result in a download.

Attached are AutoPkg results of two consecutive runs, the first finds updates for the two recipes and posts to Slack without error, then the next run has no updates and errors out twice.
2-recipesWithNoUpdates-run.txt
1-recipesWithUpdates-run.txt

from autopkg-recipes.

notverypc avatar notverypc commented on May 20, 2024

🤬 My bad - I'll dig into it in the morning- Sorry 🙏

from autopkg-recipes.

notverypc avatar notverypc commented on May 20, 2024

Should be working now - sorry for all the pain 🙏

from autopkg-recipes.

ggeerraalldd avatar ggeerraalldd commented on May 20, 2024

That ran error free on my AutoPkg test server. I changed my production server to use SlackPostCurl instead of Slacker so I'll see what happens on its next scheduled run.

from autopkg-recipes.

ggeerraalldd avatar ggeerraalldd commented on May 20, 2024

The full recipe list on my production server ran via autopkg-conductor.sh using SlackPostCurl as the post processor, and worked as expected!

Thank you so much for the bug fix. I appreciate all your effort. :)

from autopkg-recipes.

notverypc avatar notverypc commented on May 20, 2024

Pleased to hear it's working :)
Sorry for the pain :)

from autopkg-recipes.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.