Errno::EAFNOSUPPORT(协议不支持地址族 - 套接字(2)):

发布于 2024-10-11 16:33:05 字数 326 浏览 1 评论 0原文

Errno::EAFNOSUPPORT (Address family not supported by protocol - socket(2)): 

来自 Heroku、devise、sendgrid 的错误消息。希望有人能解释并帮助我解决。

现在是这样的:

Net::SMTPAuthenticationError (535 5.7.8 Error: authentication failed: authentication failure):

更新

我回答了我自己的问题。

Errno::EAFNOSUPPORT (Address family not supported by protocol - socket(2)): 

Error message from Heroku, devise, sendgrid. Hoping someone can explain and help me fix.

And now its this:

Net::SMTPAuthenticationError (535 5.7.8 Error: authentication failed: authentication failure):

update

I answered my own question.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

雪落纷纷 2024-10-18 16:33:05

这些错误的描述性并不强。事实上,问题在于 sendgrid 直到创建该帐户几个小时后才配置该帐户,因此尝试在 heroku 上使用带有 sendgrid 的 devise 在相当长的一段时间内都不起作用。为我过夜。

解决方案:给它时间:(不是你想听到的,但这是事实:)

These errors were not very descriptive. In fact the problem was that sendgrid had not provisioned this account until several hours after it was created thus trying to use devise with sendgrid on heroku didn't work for quite some times. Took over night for me.

Solution: Give it time :( not what you wanted to hear but its true :)

情栀口红 2024-10-18 16:33:05

当我忘记为邮件 gem 提供 SMTP 域/地址环境变量并且它默认为 nil 或不好的值时,我也发生了类似的错误。

我说的是这些人

# config/environments/*.rb
config.action_mailer.smtp_settings = {
    port: ENV['SMTP_PORT'],
    address: ENV['SMTP_HOST'],
    domain: ENV['SMTP_DOMAIN'],
  }.tap do |settings|
    if ENV['SMTP_USER'].present? || ENV['SMTP_PASSWORD'].present?
      settings[:user_name] = ENV['SMTP_USER']
      settings[:password] = ENV['SMTP_PASSWORD']
      settings[:authentication] = ENV['SMTP_AUTHENTICATION'] || :cram_md5
    end
  end

这让我浪费了很多时间认为 ipv6 有问题(我们最近重新安装了没有 ipv6 支持的 k8s 集群,并且其他应用程序也遇到了类似的问题)

......当我偶然发现时甚至更多2019 年的一些 github 问题评论提到 net SMTP gem 有 ipv6 问题 =_=

A similar error occured to me when I forgot to provision SMTP domain/address environment variables for the mail gem and it defaulted to nil or not good values.

I'm talking about these guys

# config/environments/*.rb
config.action_mailer.smtp_settings = {
    port: ENV['SMTP_PORT'],
    address: ENV['SMTP_HOST'],
    domain: ENV['SMTP_DOMAIN'],
  }.tap do |settings|
    if ENV['SMTP_USER'].present? || ENV['SMTP_PASSWORD'].present?
      settings[:user_name] = ENV['SMTP_USER']
      settings[:password] = ENV['SMTP_PASSWORD']
      settings[:authentication] = ENV['SMTP_AUTHENTICATION'] || :cram_md5
    end
  end

It made me waste a lot of time thinking there was a problem with ipv6 (we recently reinstalled our k8s cluster without ipv6 support and had similar problems with other applications)

... and even more when I stumbled across some github issue comment from 2019 mentioning the net SMTP gem had problems with ipv6 =_=

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文