gpt4 book ai didi

ejabberd - Phoenix/Elixir/Ejabberd - 响应已发送错误

转载 作者:行者123 更新时间:2023-12-03 16:45:19 28 4
gpt4 key购买 nike

我正在按照本指南将 Ejabberd 嵌入到 Phoenix 应用程序 ( https://blog.process-one.net/embedding-ejabberd-into-an-elixir-phoenix-web-application/ ) 中,但现在它正在运行时出现错误。

基本上,一切似乎都正常,直到我导航到“http://localhost:4000/ejabberd ”,此时我收到以下错误:

[error] #PID<0.721.0> running EjbrdTest.Endpoint terminated Server: localhost:4000 (http) Request: GET /ejabberd ** (exit) an exception was raised: ** (Plug.Conn.AlreadySentError) the response was already sent (plug) lib/plug/conn.ex:428: Plug.Conn.resp/3 (plug) lib/plug/conn.ex:415: Plug.Conn.send_resp/3 (ejbrdTest) web/controllers/ejabberd_controller.ex:1: EjbrdTest.EjabberdController.phoenix_controller_pipeline/2 (ejbrdTest) lib/phoenix/router.ex:265: EjbrdTest.Router.dispatch/2 (ejbrdTest) web/router.ex:1: EjbrdTest.Router.do_call/2 (ejbrdTest) lib/ejbrdTest/endpoint.ex:1: EjbrdTest.Endpoint.phoenix_pipeline/1 (ejbrdTest) lib/plug/debugger.ex:90: EjbrdTest.Endpoint."call (overridable 3)"/2 (ejbrdTest) lib/phoenix/endpoint/render_errors.ex:34: EjbrdTest.Endpoint.call/2 (plug) lib/plug/adapters/cowboy/handler.ex:15: Plug.Adapters.Cowboy.Handler.upgrade/4 (cowboy) src/cowboy_protocol.erl:442: :cowboy_protocol.execute/4



而不是用户列表,我在 jumbotron 中看到了这个:

Online users: < %= for user <- @users do %> < %= user %>

< % end %>



我一直无法找到任何关于此的任何想法?

谢谢。如果您需要更多信息,请告诉我。

最佳答案

删除 plug :action将解决问题。看起来现在默认调用它,因此该行会导致重复错误:

https://github.com/phoenixframework/phoenix/issues/888

关于ejabberd - Phoenix/Elixir/Ejabberd - 响应已发送错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32448308/

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