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

[Bug]: Unable to Access Helicon Localhost URL - SyntaxError in clickhouse-migration-runner #2965

Open
mohilmakwana3107 opened this issue Nov 14, 2024 · 9 comments
Labels
bug Something isn't working

Comments

@mohilmakwana3107
Copy link

mohilmakwana3107 commented Nov 14, 2024

What happened?

I'm attempting to self-host Helicon on my local machine, but I can't access http://localhost:8989/project/default/auth/users. The console logs show the following error:

clickhouse-migration-runner      |   File "ch_hcone.py", line 35
clickhouse-migration-runner      |     curl_cmd = f"cat \"{migration_file}\" | curl '{
clickhouse-migration-runner      |                                                   ^
clickhouse-migration-runner      | SyntaxError: EOL while scanning string literal
clickhouse-migration-runner exited with code 1

I've checked the documentation and can't find any steps I might have missed.

Edit :

  • There seems to be no process running on 8989
    image

Relevant log output

No response

Twitter / LinkedIn details

No response

@mohilmakwana3107 mohilmakwana3107 added the bug Something isn't working label Nov 14, 2024
@thiagoscodelerae
Copy link

@mohilmakwana3107 You can access the Supabase auth users here: http://localhost:54323/project/default/auth/users

@thiagoscodelerae
Copy link

thiagoscodelerae commented Nov 15, 2024

Due to the lack of migration execution, the logs are showing missing tables on Clickhouse:

helicone-web-local               |   2024-11-15T14:28:36.531Z
helicone-web-local               | ]
helicone-web-local               | ClickHouseError: Table default.request_response_rmt doesn't exist.
helicone-web-local               |     at parseError (/app/web/node_modules/@clickhouse/client/dist/error/parse_error.js:32:16)
helicone-web-local               |     at ClientRequest.onResponse (/app/web/node_modules/@clickhouse/client/dist/connection/adapter/base_http_adapter.js:127:51)
helicone-web-local               |     at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
helicone-web-local               |   code: '60',
helicone-web-local               |   type: 'UNKNOWN_TABLE'
helicone-web-local               | }

@mohilmakwana3107
Copy link
Author

@thiagoscodelerae
How to solve it?

@thiagoscodelerae
Copy link

@mohilmakwana3107 I'm trying that right now (also want to setup self hosted Helicone). I saw some people reporting the same error on Discord.

@thiagoscodelerae
Copy link

thiagoscodelerae commented Nov 15, 2024

Here is how I solved that.

1 - Change code ch_hcone.py from:

def run_curl_command(query, host, port, user=None, password=None, migration_file=None):

    if not query:
        curl_cmd = f"cat \"{migration_file}\" | curl '{
            get_host(host)}:{port}/' --data-binary @-"
        if user and password:
            curl_cmd = f"cat \"{migration_file}\" | curl --user '{user}:{
                password}' '{get_host(host)}:{port}/' --data-binary @-"
    else:
        curl_cmd = f"echo \"{query}\" | curl '{
            get_host(host)}:{port}/' --data-binary @-"
        if user and password:
            curl_cmd = f"echo \"{
                query}\" | curl --user '{user}:{password}' '{get_host(host)}:{port}/' --data-binary @-"

    result = subprocess.run(curl_cmd, shell=True,
                            capture_output=True, text=True)
    if (result.returncode != 0):
        print("Error running query")
        print("STDOUT:", result.stdout)
        print("STDERR:", result.stderr)
        sys.exit(1)
    return result

To:

def run_curl_command(query, host, port, user=None, password=None, migration_file=None):
    if not query:
        curl_cmd = f"cat \"{migration_file}\" | curl '{get_host(host)}:{port}/' --data-binary @-"
        if user and password:
            curl_cmd = f"cat \"{migration_file}\" | curl --user '{user}:{password}' '{get_host(host)}:{port}/' --data-binary @-"
    else:
        curl_cmd = f"echo \"{query}\" | curl '{get_host(host)}:{port}/' --data-binary @-"
        if user and password:
            curl_cmd = f"echo \"{query}\" | curl --user '{user}:{password}' '{get_host(host)}:{port}/' --data-binary @-"

    result = subprocess.run(curl_cmd, shell=True,
                            capture_output=True, text=True)
    if (result.returncode != 0):
        print("Error running query")
        print("STDOUT:", result.stdout)
        print("STDERR:", result.stderr)
        sys.exit(1)
    return result

2 - Add tabulate package as part of Dockerfile installation. I created a requirements.txt file here "helicone/clickhouse/requirements.txt" with tabulate package only.

And add the following instruction "helicone/docker/dockerfiles/dockerfile_clickhouse_migration_runner"

:::
COPY . /app
RUN find /app -name ".env.*" -exec rm {} \;

RUN pip3 install --no-cache-dir -r requirements.txt
:::

3 - Run docker compose:

docker compose up --build

@mohilmakwana3107
Copy link
Author

Ok,
Thanks @thiagoscodelerae
And I was the one who created that issue in discord chat.

@thiagoscodelerae
Copy link

@mohilmakwana3107 one more step :)

Add MINIO env vars to .env file:

MINIO_ROOT_USER=minioadminuser
MINIO_ROOT_PASSWORD=minioadminuser

You can change the value as well.

@mohilmakwana3107
Copy link
Author

Ok thanks @thiagoscodelerae

@thiagoscodelerae
Copy link

thiagoscodelerae commented Nov 18, 2024

@mohilmakwana3107 there is now a new issue happening when sending a request to OpenAI/Helicone:

Error parsing default response: SyntaxError: Unexpected token '!', "!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants