paul-sx / huginn_mattermost_urls_to_files

MIT License
0 stars 1 forks source link

Breaks latest huginn installation #2

Closed skin-soc closed 1 year ago

skin-soc commented 1 year ago

When including huginn_mattermost_urls_to_files gem as an additional gem (.env), the latest version of huginn will not launch. It took me a while to figure out it was this gem, but unfortunately it is.

foreman stderr | rake aborted!
foreman stderr | NameError: uninitialized class variable @@schemes in URI

I suspect it might originate from here?

def mattermost_client @mattermost_client ||= Faraday.new(url: interpolated['mattermost_server_url']) do |builder| ... end

Any ideas anyone?

(Huginn will launch no problem when gem is excluded from additional gems).

paul-sx commented 1 year ago

I believe this is a version-related conflict in the required URI package. Are you able to test the following solution from stack overflow?

add gem 'globalid', '~> 1.0' and then bundle install

See https://stackoverflow.com/questions/73559113/uninitialized-class-variable-schemes-in-uri

Let me know if that works and I'll see if it breaks other things.

skin-soc commented 1 year ago

We did try a few proposed solutions to similar reported @@schemes issues - as many as we could find on stackoverflow - including adding globalid, it did not fix it at our end.

FYI, given that Huginn does not officially support Ubuntu > 18, we went as far as having 3 VMs each with a different version of Ubuntu (18, 20, 22) to see if there was a difference, and there wasn't.

paul-sx commented 1 year ago

OK, so I think I figured it out....

Huginn requires ruby-growl. Ruby-growl depends on URI being there (seemingly without specifying a version) and adds a growl custom URI. The problem is that the way that it does so is out of date. URI changed to eliminate the @@schemes variable for compatibility with Ruby 3.0 Racter in May 2021. That appears to have caught up with us.

This agent made the mistake of importing URI unrestrained, which imports the current version. I've removed the URI dependency from this agent, so URI is not upgraded and instead is its older version, which works with ruby-growl. This doesn't appear to break the agent, but see if you run into any problems.

skin-soc commented 1 year ago

Thank you very much, this has fixed this gem our end! 🤙🏻