Getting Phoenix error: [warn] Phoenix is unable to create symlinks

Please help me out. I am creating a chat applications, When I am running this I am getting issues please check my logs

[warn] Phoenix is unable to create symlinks. Phoenix' code reloader will run considerably faster if symlinks are allowed. On Win   dows, the lack of symlinks may even cause empty assets to be served. Luckily, you can address this issue by starting your Window   s terminal at least once with "Run as Administrator" and then running your Phoenix application.
[info] Running ChatWeb.Endpoint with Cowboy using http://0.0.0.0:4000
13:56:32 - info: compiling
13:56:32 - info: compiled 6 files into 2 files, copied 3 in 4.8 sec
[info] GET /
[debug] Processing with ChatWeb.PageController.index/2
  Parameters: %{}
  Pipelines: [:browser]
[info] Sent 200 in 16ms
[error] Ranch protocol #PID<0.909.0> of listener ChatWeb.Endpoint.HTTP (cowboy_protocol) terminated
** (exit) exited in: Phoenix.Endpoint.CowboyWebSocket.resume()
    ** (EXIT) an exception was raised:
        ** (UndefinedFunctionError) function ChatWeb.RoomChannel.__socket__/1 is undefined (module ChatWeb.RoomChannel is not av   ailable)
            ChatWeb.RoomChannel.__socket__(:private)
            (phoenix) lib/phoenix/socket/transport.ex:261: Phoenix.Socket.Transport.build_channel_socket/5
            (phoenix) lib/phoenix/socket/transport.ex:267: Phoenix.Socket.Transport.do_dispatch/3
            (phoenix) lib/phoenix/transports/websocket.ex:123: Phoenix.Transports.WebSocket.ws_handle/3
            (phoenix) lib/phoenix/endpoint/cowboy_websocket.ex:77: Phoenix.Endpoint.CowboyWebSocket.websocket_handle/3
            (cowboy) e:/projects/Chat/elixirPro/Chatchat/Chat/deps/cowboy/src/cowboy_websocket.erl:588: :cowboy_websocket.handle   r_call/7
            (phoenix) lib/phoenix/endpoint/cowboy_websocket.ex:49: Phoenix.Endpoint.CowboyWebSocket.resume/3
            (cowboy) e:/projects/Chat/elixirPro/Chatchat/Chat/deps/cowboy/src/cowboy_protocol.erl:442: :cowboy_protocol.execute/   4
[error] Ranch protocol #PID<0.914.0> of listener ChatWeb.Endpoint.HTTP (cowboy_protocol) terminated
** (exit) exited in: Phoenix.Endpoint.CowboyWebSocket.resume()
    ** (EXIT) an exception was raised:
        ** (UndefinedFunctionError) function ChatWeb.RoomChannel.__socket__/1 is undefined (module ChatWeb.RoomChannel is not av   ailable)
            ChatWeb.RoomChannel.__socket__(:private)
            (phoenix) lib/phoenix/socket/transport.ex:261: Phoenix.Socket.Transport.build_channel_socket/5
            (phoenix) lib/phoenix/socket/transport.ex:267: Phoenix.Socket.Transport.do_dispatch/3
            (phoenix) lib/phoenix/transports/websocket.ex:123: Phoenix.Transports.WebSocket.ws_handle/3
            (phoenix) lib/phoenix/endpoint/cowboy_websocket.ex:77: Phoenix.Endpoint.CowboyWebSocket.websocket_handle/3
            (cowboy) e:/projects/Chat/elixirPro/Chatchat/Chat/deps/cowboy/src/cowboy_websocket.erl:588: :cowboy_websocket.handle   r_call/7
            (phoenix) lib/phoenix/endpoint/cowboy_websocket.ex:49: Phoenix.Endpoint.CowboyWebSocket.resume/3
            (cowboy) e:/projects/Chat/elixirPro/Chatchat/Chat/deps/cowboy/src/cowboy_protocol.erl:442: :cowboy_protocol.execute/   4
[error] Ranch protocol #PID<0.916.0> of listener ChatWeb.Endpoint.HTTP (cowboy_protocol) terminated
** (exit) exited in: Phoenix.Endpoint.CowboyWebSocket.resume()
    ** (EXIT) an exception was raised:
        ** (UndefinedFunctionError) function ChatWeb.RoomChannel.__socket__/1 is undefined (module ChatWeb.RoomChannel is not av   ailable)
            ChatWeb.RoomChannel.__socket__(:private)
            (phoenix) lib/phoenix/socket/transport.ex:261: Phoenix.Socket.Transport.build_channel_socket/5
            (phoenix) lib/phoenix/socket/transport.ex:267: Phoenix.Socket.Transport.do_dispatch/3
            (phoenix) lib/phoenix/transports/websocket.ex:123: Phoenix.Transports.WebSocket.ws_handle/3
            (phoenix) lib/phoenix/endpoint/cowboy_websocket.ex:77: Phoenix.Endpoint.CowboyWebSocket.websocket_handle/3
            (cowboy) e:/projects/Chat/elixirPro/Chatchat/Chat/deps/cowboy/src/cowboy_websocket.erl:588: :cowboy_websocket.handle   r_call/7
            (phoenix) lib/phoenix/endpoint/cowboy_websocket.ex:49: Phoenix.Endpoint.CowboyWebSocket.resume/3
            (cowboy) e:/projects/Chat/elixirPro/Chatchat/Chat/deps/cowboy/src/cowboy_protocol.erl:442: :cowboy_protocol.execute/   4
[error] Ranch protocol #PID<0.918.0> of listener ChatWeb.Endpoint.HTTP (cowboy_protocol) terminated
** (exit) exited in: Phoenix.Endpoint.CowboyWebSocket.resume()
    ** (EXIT) an exception was raised:
        ** (UndefinedFunctionError) function ChatWeb.RoomChannel.__socket__/1 is undefined (module ChatWeb.RoomChannel is not av   ailable)
            ChatWeb.RoomChannel.__socket__(:private)
            (phoenix) lib/phoenix/socket/transport.ex:261: Phoenix.Socket.Transport.build_channel_socket/5
            (phoenix) lib/phoenix/socket/transport.ex:267: Phoenix.Socket.Transport.do_dispatch/3
            (phoenix) lib/phoenix/transports/websocket.ex:123: Phoenix.Transports.WebSocket.ws_handle/3
            (phoenix) lib/phoenix/endpoint/cowboy_websocket.ex:77: Phoenix.Endpoint.CowboyWebSocket.websocket_handle/3
            (cowboy) e:/projects/Chat/elixirPro/Chatchat/Chat/deps/cowboy/src/cowboy_websocket.erl:588: :cowboy_websocket.handle   r_call/7
            (phoenix) lib/phoenix/endpoint/cowboy_websocket.ex:49: Phoenix.Endpoint.CowboyWebSocket.resume/3
            (cowboy) e:/projects/Chat/elixirPro/Chatchat/Chat/deps/cowboy/src/cowboy_protocol.erl:442: :cowboy_protocol.execute/   4
[error] Ranch protocol #PID<0.920.0> of listener ChatWeb.Endpoint.HTTP (cowboy_protocol) terminated
** (exit) exited in: Phoenix.Endpoint.CowboyWebSocket.resume()
    ** (EXIT) an exception was raised:
        ** (UndefinedFunctionError) function ChatWeb.RoomChannel.__socket__/1 is undefined (module ChatWeb.RoomChannel is not av   ailable)
            ChatWeb.RoomChannel.__socket__(:private)
            (phoenix) lib/phoenix/socket/transport.ex:261: Phoenix.Socket.Transport.build_channel_socket/5
            (phoenix) lib/phoenix/socket/transport.ex:267: Phoenix.Socket.Transport.do_dispatch/3
            (phoenix) lib/phoenix/transports/websocket.ex:123: Phoenix.Transports.WebSocket.ws_handle/3
            (phoenix) lib/phoenix/endpoint/cowboy_websocket.ex:77: Phoenix.Endpoint.CowboyWebSocket.websocket_handle/3
            (cowboy) e:/projects/Chat/elixirPro/Chatchat/Chat/deps/cowboy/src/cowboy_websocket.erl:588: :cowboy_websocket.handle   r_call/7
            (phoenix) lib/phoenix/endpoint/cowboy_websocket.ex:49: Phoenix.Endpoint.CowboyWebSocket.resume/3
            (cowboy) e:/projects/Chat/elixirPro/Chatchat/Chat/deps/cowboy/src/cowboy_protocol.erl:442: :cowboy_protocol.execute/   4
[error] Ranch protocol #PID<0.922.0> of listener ChatWeb.Endpoint.HTTP (cowboy_protocol) terminated
** (exit) exited in: Phoenix.Endpoint.CowboyWebSocket.resume()
    ** (EXIT) an exception was raised:
        ** (UndefinedFunctionError) function ChatWeb.RoomChannel.__socket__/1 is undefined (module ChatWeb.RoomChannel is not av   ailable)
            ChatWeb.RoomChannel.__socket__(:private)
            (phoenix) lib/phoenix/socket/transport.ex:261: Phoenix.Socket.Transport.build_channel_socket/5
            (phoenix) lib/phoenix/socket/transport.ex:267: Phoenix.Socket.Transport.do_dispatch/3
            (phoenix) lib/phoenix/transports/websocket.ex:123: Phoenix.Transports.WebSocket.ws_handle/3
            (phoenix) lib/phoenix/endpoint/cowboy_websocket.ex:77: Phoenix.Endpoint.CowboyWebSocket.websocket_handle/3
            (cowboy) e:/projects/Chat/elixirPro/Chatchat/Chat/deps/cowboy/src/cowboy_websocket.erl:588: :cowboy_websocket.handle   r_call/7
            (phoenix) lib/phoenix/endpoint/cowboy_websocket.ex:49: Phoenix.Endpoint.CowboyWebSocket.resume/3
            (cowboy) e:/projects/Chat/elixirPro/Chatchat/Chat/deps/cowboy/src/cowboy_protocol.erl:442: :cowboy_protocol.execute/   4
[error] Ranch protocol #PID<0.925.0> of listener ChatWeb.Endpoint.HTTP (cowboy_protocol) terminated
** (exit) exited in: Phoenix.Endpoint.CowboyWebSocket.resume()
    ** (EXIT) an exception was raised:
        ** (UndefinedFunctionError) function ChatWeb.RoomChannel.__socket__/1 is undefined (module ChatWeb.RoomChannel is not avail
            ChatWeb.RoomChannel.__socket__(:private)
            (phoenix) lib/phoenix/socket/transport.ex:261: Phoenix.Socket.Transport.build_channel_socket/5
            (phoenix) lib/phoenix/socket/transport.ex:267: Phoenix.Socket.Transport.do_dispatch/3
            (phoenix) lib/phoenix/transports/websocket.ex:123: Phoenix.Transports.WebSocket.ws_handle/3
            (phoenix) lib/phoenix/endpoint/cowboy_websocket.ex:77: Phoenix.Endpoint.CowboyWebSocket.websocket_handle/3
            (cowboy) e:/projects/Chat/elixirPro/Chatchat/Chat/deps/cowboy/src/cowboy_websocket.erl:588: :cowboy_websocket.handler_c
            (phoenix) lib/phoenix/endpoint/cowboy_websocket.ex:49: Phoenix.Endpoint.CowboyWebSocket.resume/3
            (cowboy) e:/projects/Chat/elixirPro/Chatchat/Chat/deps/cowboy/src/cowboy_protocol.erl:442: :cowboy_protocol.execute/4
[error] Ranch protocol #PID<0.927.0> of listener ChatWeb.Endpoint.HTTP (cowboy_protocol) terminated
** (exit) exited in: Phoenix.Endpoint.CowboyWebSocket.resume()
    ** (EXIT) an exception was raised:
        ** (UndefinedFunctionError) function ChatWeb.RoomChannel.__socket__/1 is undefined (module ChatWeb.RoomChannel is not avail
            ChatWeb.RoomChannel.__socket__(:private)
            (phoenix) lib/phoenix/socket/transport.ex:261: Phoenix.Socket.Transport.build_channel_socket/5
            (phoenix) lib/phoenix/socket/transport.ex:267: Phoenix.Socket.Transport.do_dispatch/3
            (phoenix) lib/phoenix/transports/websocket.ex:123: Phoenix.Transports.WebSocket.ws_handle/3
            (phoenix) lib/phoenix/endpoint/cowboy_websocket.ex:77: Phoenix.Endpoint.CowboyWebSocket.websocket_handle/3
            (cowboy) e:/projects/Chat/elixirPro/Chatchat/Chat/deps/cowboy/src/cowboy_websocket.erl:588: :cowboy_websocket.handler_c
            (phoenix) lib/phoenix/endpoint/cowboy_websocket.ex:49: Phoenix.Endpoint.CowboyWebSocket.resume/3
            (cowboy) e:/projects/Chat/elixirPro/Chatchat/Chat/deps/cowboy/src/cowboy_protocol.erl:442: :cowboy_protocol.execute/4
[error] Ranch protocol #PID<0.929.0> of listener ChatWeb.Endpoint.HTTP (cowboy_protocol) terminated
** (exit) exited in: Phoenix.Endpoint.CowboyWebSocket.resume()
    ** (EXIT) an exception was raised:
        ** (UndefinedFunctionError) function ChatWeb.RoomChannel.__socket__/1 is undefined (module ChatWeb.RoomChannel is not avail
            ChatWeb.RoomChannel.__socket__(:private)
            (phoenix) lib/phoenix/socket/transport.ex:261: Phoenix.Socket.Transport.build_channel_socket/5
            (phoenix) lib/phoenix/socket/transport.ex:267: Phoenix.Socket.Transport.do_dispatch/3
            (phoenix) lib/phoenix/transports/websocket.ex:123: Phoenix.Transports.WebSocket.ws_handle/3
            (phoenix) lib/phoenix/endpoint/cowboy_websocket.ex:77: Phoenix.Endpoint.CowboyWebSocket.websocket_handle/3
            (cowboy) e:/projects/Chat/elixirPro/Chatchat/Chat/deps/cowboy/src/cowboy_websocket.erl:588: :cowboy_websocket.handler_c
            (phoenix) lib/phoenix/endpoint/cowboy_websocket.ex:49: Phoenix.Endpoint.CowboyWebSocket.resume/3
            (cowboy) e:/projects/Chat/elixirPro/Chatchat/Chat/deps/cowboy/src/cowboy_protocol.erl:442: :cowboy_protocol.execute/4
[error] Ranch protocol #PID<0.931.0> of listener ChatWeb.Endpoint.HTTP (cowboy_protocol) terminated
** (exit) exited in: Phoenix.Endpoint.CowboyWebSocket.resume()
    ** (EXIT) an exception was raised:
        ** (UndefinedFunctionError) function ChatWeb.RoomChannel.__socket__/1 is undefined (module ChatWeb.RoomChannel is not avail
            ChatWeb.RoomChannel.__socket__(:private)
            (phoenix) lib/phoenix/socket/transport.ex:261: Phoenix.Socket.Transport.build_channel_socket/5
            (phoenix) lib/phoenix/socket/transport.ex:267: Phoenix.Socket.Transport.do_dispatch/3
            (phoenix) lib/phoenix/transports/websocket.ex:123: Phoenix.Transports.WebSocket.ws_handle/3
            (phoenix) lib/phoenix/endpoint/cowboy_websocket.ex:77: Phoenix.Endpoint.CowboyWebSocket.websocket_handle/3
            (cowboy) e:/projects/Chat/elixirPro/Chatchat/Chat/deps/cowboy/src/cowboy_websocket.erl:588: :cowboy_websocket.handler_c
            (phoenix) lib/phoenix/endpoint/cowboy_websocket.ex:49: Phoenix.Endpoint.CowboyWebSocket.resume/3
            (cowboy) e:/projects/Chat/elixirPro/Chatchat/Chat/deps/cowboy/src/cowboy_protocol.erl:442: :cowboy_protocol.execute/4
[error] Ranch protocol #PID<0.933.0> of listener ChatWeb.Endpoint.HTTP (cowboy_protocol) terminated
** (exit) exited in: Phoenix.Endpoint.CowboyWebSocket.resume()
    ** (EXIT) an exception was raised:
        ** (UndefinedFunctionError) function ChatWeb.RoomChannel.__socket__/1 is undefined (module ChatWeb.RoomChannel is not avail
            ChatWeb.RoomChannel.__socket__(:private)
            (phoenix) lib/phoenix/socket/transport.ex:261: Phoenix.Socket.Transport.build_channel_socket/5
            (phoenix) lib/phoenix/socket/transport.ex:267: Phoenix.Socket.Transport.do_dispatch/3
            (phoenix) lib/phoenix/transports/websocket.ex:123: Phoenix.Transports.WebSocket.ws_handle/3
            (phoenix) lib/phoenix/endpoint/cowboy_websocket.ex:77: Phoenix.Endpoint.CowboyWebSocket.websocket_handle/3
            (cowboy) e:/projects/Chat/elixirPro/Chatchat/Chat/deps/cowboy/src/cowboy_websocket.erl:588: :cowboy_websocket.handler_c
            (phoenix) lib/phoenix/endpoint/cowboy_websocket.ex:49: Phoenix.Endpoint.CowboyWebSocket.resume/3
            (cowboy) e:/projects/Chat/elixirPro/Chatchat/Chat/deps/cowboy/src/cowboy_protocol.erl:442: :cowboy_protocol.execute/4
[error] Ranch protocol #PID<0.935.0> of listener ChatWeb.Endpoint.HTTP (cowboy_protocol) terminated
** (exit) exited in: Phoenix.Endpoint.CowboyWebSocket.resume()
    ** (EXIT) an exception was raised:
        ** (UndefinedFunctionError) function ChatWeb.RoomChannel.__socket__/1 is undefined (module ChatWeb.RoomChannel is not avail
            ChatWeb.RoomChannel.__socket__(:private)
            (phoenix) lib/phoenix/socket/transport.ex:261: Phoenix.Socket.Transport.build_channel_socket/5
            (phoenix) lib/phoenix/socket/transport.ex:267: Phoenix.Socket.Transport.do_dispatch/3
            (phoenix) lib/phoenix/transports/websocket.ex:123: Phoenix.Transports.WebSocket.ws_handle/3
            (phoenix) lib/phoenix/endpoint/cowboy_websocket.ex:77: Phoenix.Endpoint.CowboyWebSocket.websocket_handle/3
            (cowboy) e:/projects/Chat/elixirPro/Chatchat/Chat/deps/cowboy/src/cowboy_websocket.erl:588: :cowboy_websocket.handler_c
            (phoenix) lib/phoenix/endpoint/cowboy_websocket.ex:49: Phoenix.Endpoint.CowboyWebSocket.resume/3
            (cowboy) e:/projects/Chat/elixirPro/Chatchat/Chat/deps/cowboy/src/cowboy_protocol.erl:442: :cowboy_protocol.execute/4
[error] Ranch protocol #PID<0.937.0> of listener ChatWeb.Endpoint.HTTP (cowboy_protocol) terminated
** (exit) exited in: Phoenix.Endpoint.CowboyWebSocket.resume()
    ** (EXIT) an exception was raised:
        ** (UndefinedFunctionError) function ChatWeb.RoomChannel.__socket__/1 is undefined (module ChatWeb.RoomChannel is not avail
            ChatWeb.RoomChannel.__socket__(:private)
            (phoenix) lib/phoenix/socket/transport.ex:261: Phoenix.Socket.Transport.build_channel_socket/5
            (phoenix) lib/phoenix/socket/transport.ex:267: Phoenix.Socket.Transport.do_dispatch/3
            (phoenix) lib/phoenix/transports/websocket.ex:123: Phoenix.Transports.WebSocket.ws_handle/3
            (phoenix) lib/phoenix/endpoint/cowboy_websocket.ex:77: Phoenix.Endpoint.CowboyWebSocket.websocket_handle/3
            (cowboy) e:/projects/Chat/elixirPro/Chatchat/Chat/deps/cowboy/src/cowboy_websocket.erl:588: :cowboy_websocket.handler_c
            (phoenix) lib/phoenix/endpoint/cowboy_websocket.ex:49: Phoenix.Endpoint.CowboyWebSocket.resume/3
            (cowboy) e:/projects/Chat/elixirPro/Chatchat/Chat/deps/cowboy/src/cowboy_protocol.erl:442: :cowboy_protocol.execute/4
[error] Ranch protocol #PID<0.939.0> of listener ChatWeb.Endpoint.HTTP (cowboy_protocol) terminated
** (exit) exited in: Phoenix.Endpoint.CowboyWebSocket.resume()
    ** (EXIT) an exception was raised:
        ** (UndefinedFunctionError) function ChatWeb.RoomChannel.__socket__/1 is undefined (module ChatWeb.RoomChannel is not avail
            ChatWeb.RoomChannel.__socket__(:private)
            (phoenix) lib/phoenix/socket/transport.ex:261: Phoenix.Socket.Transport.build_channel_socket/5
            (phoenix) lib/phoenix/socket/transport.ex:267: Phoenix.Socket.Transport.do_dispatch/3
            (phoenix) lib/phoenix/transports/websocket.ex:123: Phoenix.Transports.WebSocket.ws_handle/3
            (phoenix) lib/phoenix/endpoint/cowboy_websocket.ex:77: Phoenix.Endpoint.CowboyWebSocket.websocket_handle/3
            (cowboy) e:/projects/Chat/elixirPro/Chatchat/Chat/deps/cowboy/src/cowboy_websocket.erl:588: :cowboy_websocket.handler_c
            (phoenix) lib/phoenix/endpoint/cowboy_websocket.ex:49: Phoenix.Endpoint.CowboyWebSocket.resume/3
            (cowboy) e:/projects/Chat/elixirPro/Chatchat/Chat/deps/cowboy/src/cowboy_protocol.erl:442: :cowboy_protocol.execute/4

:wave:

It might be a good idea to post logs such as these to gist.github.com and leave a link here.


As for your problem, does the warning message at the top of your logs help you in any way?

[warn] Phoenix is unable to create symlinks. Phoenix’ code reloader will run considerably faster if symlinks are allowed. On Win dows, the lack of symlinks may even cause empty assets to be served. Luckily, you can address this issue by starting your Window s terminal at least once with “Run as Administrator” and then running your Phoenix application.

1 Like

I’ve seen this before and running the shell (or actually VS Code in my case since that’s where I run my shells) as Administrator fixes it, at least on my setup.

Good suggestions for posting a long logs on https://gist.github.com/ .

When I open terminal “Run as Administrator” but HTTP and socket issues still there.

When I open terminal “Run as Administrator” but HTTP and socket issues still there.

What can be a solution for this.

[error] Ranch protocol #PID<0.909.0> of listener ChatWeb.Endpoint.HTTP (cowboy_protocol) terminated
** (exit) exited in: Phoenix.Endpoint.CowboyWebSocket.resume()

I resolved the issue now.

Sorry guys, It was my mistake i didn’t make changes in /lib/chat_web/channels/user_socket.ex
with Elixir generated code in Terminal.

1 Like