WebSocketBundle icon indicating copy to clipboard operation
WebSocketBundle copied to clipboard

Error to install composer

Open Tywors opened this issue 4 years ago • 5 comments

I have this error when execute composer:

You have requested a non-existent parameter "gos_web_socket.server.host"

problem? thanks!

Tywors avatar Aug 30 '20 19:08 Tywors

What version of the bundle?

It's been a long while since I've done a fresh install into a Symfony application, but IIRC the bundle's default configuration causes that error on a totally new install until you set things up. And, last time I tried creating a recipe for the bundle I just ran into too many quirks with the recipe checker to make it work efficiently, so I haven't tried again to be able to avoid the initial error message.

Try this as a baseline for the bundle config, place it at config/packages/gos_web_socket.yaml:

parameters:
    # Adds fallback params in case the corresponding env vars are not set.
    # This allows you to run cache:warmup even if your
    # environment variables are not available yet.
    # You should not need to change this value.
    env(GOS_WEB_SOCKET_SERVER_IP): '127.0.0.1'
    env(GOS_WEB_SOCKET_SERVER_PORT): 1337

gos_web_socket:
    server:
        port: '%env(int:GOS_WEB_SOCKET_SERVER_PORT)%' # The port the socket server will listen on
        host: '%env(GOS_WEB_SOCKET_SERVER_IP)%'       # The host ip to bind to
        router:
            resources:
                -
                    resource: '%kernel.project_dir%/config/pubsub/websocket/*'
                    type: 'glob'

mbabker avatar Aug 31 '20 14:08 mbabker

I have the same problem - I tried to install version >=3.4.0 and get the same error message: You have requested a non-existent parameter "gos_web_socket.server.host". After having added config/packages/gos_web_socket.yaml I ran the installation a second time - but this time I get the error: !! In FileLocator.php line 44: !! !! The file "//config/pubsub/websocket" does not exist.

xxxMikel avatar Oct 07 '20 10:10 xxxMikel

Create the config/pubsub/websocket directory.

If I can find time, I'll see if I can make a recipe for 3.0 that works and maybe that helps with some of the initial install struggles. When I tried the recipe last, it was for 2.3 and it just did not go well at all because of the wider range of supported PubSubRouterBundle versions (if anyone cares, https://github.com/symfony/recipes-contrib/pull/881 was the recipe which is pretty much the exact same advice here just automated).

mbabker avatar Oct 07 '20 15:10 mbabker

This works when I do the two steps mentioned above 👍

Lyro1 avatar Nov 18 '20 14:11 Lyro1

Hi , i have the same issue on "composer require gos/web-socket-bundle"

"You have requested a non-existent parameter "gos_web_socket.server.host""

My gos_web_socket.yaml file exist in config/packages/gos_web_socket.yaml

What can i do ?

Dekminoz avatar Dec 20 '20 15:12 Dekminoz