gpt4 book ai didi

email - GitLab:无法通过 SMTP 发送电子邮件

转载 作者:行者123 更新时间:2023-12-03 04:30:09 27 4
gpt4 key购买 nike

我在 Azure 虚拟机中的 Ubuntu 14.04.4 LTS (Trusty Tahr) 上使用 GitLab Community Edition 8.8.5 68cd138。

我配置 Postfix 失败,因此我尝试通过我的 SendGrid 帐户使用 SMTP。以前我曾成功过,但这次不行。当新用户为自己创建帐户时,我希望看到该人收到一封电子邮件,但他们从未收到过该电子邮件。

所以我查看了/var/log/gitlab/gitlab-rails/Production 并看到:

Started POST "/users" for 73.181.210.158 at 2016-06-18 03:45:55 +0000
Processing by RegistrationsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"[FILTERED]", "new_user"=>{"name"=>"mike", "username"=>"mike", "email"=>"<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="93fefaf0fbe3f2d3fbfce7fef2faffbdf0fcfe" rel="noreferrer noopener nofollow">[email protected]</a>", "password"=>"[FILTERED]"}}
[ActiveJob] Enqueued ActionMailer::DeliveryJob (Job ID: 8059c988-62ef-4d53-adac-966c6f5e3dea) to Sidekiq(mailers) with arguments: "DeviseMailer", "confirmation_instructions", "deliver_now", gid://gitlab/User/5, "BzAurLoc2kgybwF1U1Aj", {}
Redirected to http://gitlab1.westus.cloudapp.azure.com/users/almost_there
Completed 302 Found in 943ms (ActiveRecord: 52.7ms)
Started GET "/users/almost_there" for 73.181.210.158 at 2016-06-18 03:45:56 +0000
Processing by ConfirmationsController#almost_there as HTML
Completed 200 OK in 94ms (Views: 32.9ms | ActiveRecord: 0.9ms)

相关行似乎是排队的 ActionMailer::DeliveryJob(作业 ID:8059blahblah)到 Sidekiq(邮件程序),参数为:“confirmation_instructions”、“deliver_now”、gid://gitlab/User/5 - 这似乎表明 GitLab 正在尝试发送电子邮件。

GitLab documentation on logs说“GitLab 使用后台作业来处理可能需要很长时间的任务。有关处理这些作业的所有信息都写入此文件中。”因此,GitLab 将其交给 SideKiq 是有道理的。

查看/var/log/gitlab/gitlab-rails/sidekiq.log 我看到:

mike@GitLab1:/etc$ sudo less /var/log/gitlab/gitlab-rails/sidekiq.log
2016-06-18_03:45:56.18949 2016-06-18T03:45:56.189Z 1201 TID-94irw WARN: {"class":"ActiveJob::QueueAdapters::SidekiqAdapter::JobWrapper","wrapped":"ActionMailer::DeliveryJob","queue":"mailers","args":[{"job_class":"ActionMailer::DeliveryJob","job_id":"8059c988-62ef-4d53-adac-966c6f5e3dea","queue_name":"mailers","arguments":["DeviseMailer","confirmation_instructions","deliver_now",{"_aj_globalid":"gid://gitlab/User/5"},"BzAurLoc2kgybwF1U1Aj",{"_aj_symbol_keys":[]}],"locale":"en"}],"retry":true,"jid":"a921cf1158df78df6bf7ee2b","created_at":1466221556.1722102,"enqueued_at":1466221556.1723359,"error_message":"Error while trying to deserialize arguments: Couldn't find User with 'id'=5","error_class":"ActiveJob::DeserializationError","failed_at":1466221556.184139,"retry_count":0}
2016-06-18_03:45:56.18957 2016-06-18T03:45:56.189Z 1201 TID-94irw WARN: ActiveJob::DeserializationError: Error while trying to deserialize arguments: Couldn't find User with 'id'=5
2016-06-18_03:45:56.18967 2016-06-18T03:45:56.189Z 1201 TID-94irw WARN: /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activerecord-4.2.6/lib/active_record/relation/finder_methods.rb:324:in `raise_record_not_found_exception!'
2016-06-18_03:45:56.18968 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activerecord-4.2.6/lib/active_record/relation/finder_methods.rb:444:in `find_one'
2016-06-18_03:45:56.18968 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activerecord-4.2.6/lib/active_record/relation/finder_methods.rb:423:in `find_with_ids'
2016-06-18_03:45:56.18969 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activerecord-4.2.6/lib/active_record/relation/finder_methods.rb:71:in `find'
2016-06-18_03:45:56.18969 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activerecord-4.2.6/lib/active_record/querying.rb:3:in `find'
2016-06-18_03:45:56.18970 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activerecord-4.2.6/lib/active_record/core.rb:131:in `find'
2016-06-18_03:45:56.18970 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/globalid-0.3.6/lib/global_id/locator.rb:132:in `locate'
2016-06-18_03:45:56.18971 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/globalid-0.3.6/lib/global_id/locator.rb:158:in `block in locate'
2016-06-18_03:45:56.18972 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activerecord-4.2.6/lib/active_record/scoping/default.rb:33:in `block in unscoped'
2016-06-18_03:45:56.18972 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activerecord-4.2.6/lib/active_record/relation.rb:302:in `scoping'
2016-06-18_03:45:56.18973 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activerecord-4.2.6/lib/active_record/scoping/default.rb:33:in `unscoped'
2016-06-18_03:45:56.18973 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/globalid-0.3.6/lib/global_id/locator.rb:158:in `locate'
2016-06-18_03:45:56.18974 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/globalid-0.3.6/lib/global_id/locator.rb:17:in `locate'
2016-06-18_03:45:56.18974 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activejob-4.2.6/lib/active_job/arguments.rb:97:in `deserialize_global_id'
2016-06-18_03:45:56.18975 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activejob-4.2.6/lib/active_job/arguments.rb:83:in `deserialize_argument'
2016-06-18_03:45:56.18975 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activejob-4.2.6/lib/active_job/arguments.rb:40:in `block in deserialize'
2016-06-18_03:45:56.18977 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activejob-4.2.6/lib/active_job/arguments.rb:40:in `map'
2016-06-18_03:45:56.18978 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activejob-4.2.6/lib/active_job/arguments.rb:40:in `deserialize'
2016-06-18_03:45:56.18978 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activejob-4.2.6/lib/active_job/core.rb:90:in `deserialize_arguments'
2016-06-18_03:45:56.18979 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activejob-4.2.6/lib/active_job/core.rb:80:in `deserialize_arguments_if_needed'
2016-06-18_03:45:56.18979 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activejob-4.2.6/lib/active_job/execution.rb:30:in `perform_now'
2016-06-18_03:45:56.18980 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activejob-4.2.6/lib/active_job/execution.rb:21:in `execute'
2016-06-18_03:45:56.18980 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activejob-4.2.6/lib/active_job/queue_adapters/sidekiq_adapter.rb:42:in `perform'
2016-06-18_03:45:56.18980 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/sidekiq-4.1.2/lib/sidekiq/processor.rb:152:in `execute_job'
2016-06-18_03:45:56.18981 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/sidekiq-4.1.2/lib/sidekiq/processor.rb:134:in `block (2 levels) in process'
2016-06-18_03:45:56.18981 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/chain.rb:128:in `block in invoke'
2016-06-18_03:45:56.18982 /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/sidekiq_middleware/memory_killer.rb:17:in `call'
2016-06-18_03:45:56.18983 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/chain.rb:130:in `block in invoke'
2016-06-18_03:45:56.18983 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/server/active_record.rb:6:in `call'
2016-06-18_03:45:56.18984 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/chain.rb:130:in `block in invoke'
2016-06-18_03:45:56.18984 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/server/retry_jobs.rb:74:in `call'
2016-06-18_03:45:56.18984 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/chain.rb:130:in `block in invoke'
2016-06-18_03:45:56.18985 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/server/logging.rb:11:in `block in call'
2016-06-18_03:45:56.18985 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/sidekiq-4.1.2/lib/sidekiq/logging.rb:32:in `with_context'
2016-06-18_03:45:56.18986 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/server/logging.rb:7:in `call'
2016-06-18_03:45:56.18988 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/chain.rb:130:in `block in invoke'
2016-06-18_03:45:56.18989 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/chain.rb:133:in `call'
2016-06-18_03:45:56.18989 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/chain.rb:133:in `invoke'
2016-06-18_03:45:56.18990 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/sidekiq-4.1.2/lib/sidekiq/processor.rb:129:in `block in process'
2016-06-18_03:45:56.18990 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/sidekiq-4.1.2/lib/sidekiq/processor.rb:168:in `stats'
2016-06-18_03:45:56.18990 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/sidekiq-4.1.2/lib/sidekiq/processor.rb:128:in `process'
2016-06-18_03:45:56.18991 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/sidekiq-4.1.2/lib/sidekiq/processor.rb:80:in `process_one'
2016-06-18_03:45:56.18991 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/sidekiq-4.1.2/lib/sidekiq/processor.rb:68:in `run'

我认为最相关的部分是第一行的结尾:ActiveJob::DeserializationError:尝试反序列化参数时出错:找不到“id”=5的用户

看来 GitLab 无法发送电子邮件,因为无法找到刚刚创建的新用户(通过 ID 号 5)。

还有其他人遇到过这个问题和/或解决过这个问题吗?

或者,有人对接下来要尝试什么有什么建议吗?

编辑:此问题似乎类似于 https://gitlab.com/gitlab-org/gitlab-ce/issues/17250

最佳答案

现在有 GitLab 15.5 (2022 年 10 月)另一种选择:

Deliver emails using Microsoft Graph API with client credentials flow

If you’ve enabled security defaults in Azure AD,legacy authentication protocols for SMTP are blocked.

You can now configure your GitLab instance to deliver emails usingMicrosoft Graph APIwith OAuth 2.0 client credentials flow.

See Epic, Documentation and Merge Request.

关于email - GitLab:无法通过 SMTP 发送电子邮件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37893221/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com