Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add log for ws check #8370

Merged
merged 1 commit into from
May 7, 2024
Merged

Add log for ws check #8370

merged 1 commit into from
May 7, 2024

Conversation

raymondjacobson
Copy link
Member

Description

WS check is doing really strange things.

I am able to run this flavor of the check and properly connect to the host https://dn2.monophonic.digital, but it fails on the node itself

package main

import (
	"context"
	"fmt"
	"net/url"
	"os"
	"strings"

	"github.com/gobwas/ws"
)

type ChatServer struct {
	config ServerConfig
}

type ServerConfig struct {
	MyHost string
}

func (ss *ChatServer) doWebsocketTest() error {
	wsUrl, err := url.Parse(strings.Replace(ss.config.MyHost, "http", "ws", 1))
	if err != nil {
		return err
	}

	wsUrl = wsUrl.JoinPath("/comms/debug/ws")

	ctx := context.Background()
	con, _, _, err := ws.Dial(ctx, wsUrl.String())
	fmt.Println(err)
	if err != nil {
		return err
	}
	return con.Close()
}

func main() {
	// Replace with your server configuration
	serverConfig := ServerConfig{
		MyHost: "https://dn2.monophonic.digital",
	}

	chatServer := ChatServer{
		config: serverConfig,
	}

	// Perform the WebSocket test
	err := chatServer.doWebsocketTest()
	if err != nil {
		fmt.Fprintf(os.Stderr, "WebSocket Test Error: %v\n", err)
		os.Exit(1)
	}

	fmt.Println("WebSocket Test Successful")
}

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide repro instructions & any configuration.

Copy link

changeset-bot bot commented May 7, 2024

⚠️ No Changeset found

Latest commit: 1a803bd

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

@rickyrombo rickyrombo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this gonna log out something different than what we saw on the health check? I imagine the error returned is what we show there?

@raymondjacobson
Copy link
Member Author

raymondjacobson commented May 7, 2024

Is this gonna log out something different than what we saw on the health check? I imagine the error returned is what we show there?

yeah most likely. i'm worried it's not running how we expect or we lose some details in response marshaling... this is a hail mary though. also going to try more things from in the box

@raymondjacobson raymondjacobson merged commit a236c82 into main May 7, 2024
11 checks passed
@raymondjacobson raymondjacobson deleted the rj-dms-log branch May 7, 2024 05:04
audius-infra pushed a commit that referenced this pull request May 7, 2024
[a236c82] Add log for ws check (#8370) Raymond Jacobson
[44d424b] Fix pedalboard apps template import (#8346) Raymond Jacobson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants