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

Bugged UI. Does not show any task run and data flow chart #16043

Open
kavvkon opened this issue Nov 18, 2024 · 3 comments
Open

Bugged UI. Does not show any task run and data flow chart #16043

kavvkon opened this issue Nov 18, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@kavvkon
Copy link

kavvkon commented Nov 18, 2024

Bug summary

When I visualize a flow run in a local server, the flow runs successfully but the visual info on server does not work very well. I do not see any task runs, and the flow runs do not appear in the UI as blocks.
Version 2 was working fine !

Successful run:
C:\Windows>C:/Users/paul/Anaconda3/envs/prefect_env/python.exe my_gh_workflow.py

15:05:55.665 | INFO | prefect.engine - Created flow run 'righteous-dragon' for flow 'log-repo-info'
15:05:55.665 | INFO | prefect.engine - View at http://192.168.1.10:4200/runs/flow-run/b99db794-7b04-4b70-af3d-7eeb6bd51948
15:05:57.441 | INFO | Task run 'get_repo_info-2bd' - Finished in state Completed()
15:05:57.441 | INFO | Flow run 'righteous-dragon' - Stars 🌠 : 17477
15:05:59.144 | INFO | Task run 'get_contributors-838' - Finished in state Completed()
15:05:59.146 | INFO | Flow run 'righteous-dragon' - Number of contributors 👷: 30
15:05:59.188 | INFO | Flow run 'righteous-dragon' - Finished in state Completed()

image

image

Version info

Version:             3.1.1
API version:         0.8.4
Python version:      3.12.7
Git commit:          6b50a2b9
Built:               Fri, Nov 8, 2024 12:38 PM
OS/Arch:             win32/AMD64
Profile:             default
Server type:         server
Pydantic version:    2.9.2

Additional context

Calling this file my_gh_workflow.py based on this example from https://docs.prefect.io/3.0/get-started/quickstart

import httpx   # an HTTP client library and dependency of Prefect
from prefect import flow, task

@task(retries=2)
def get_repo_info(repo_owner: str, repo_name: str):
    """Get info about a repo - will retry twice after failing"""
    url = f"https://api.github.com/repos/{repo_owner}/{repo_name}"
    api_response = httpx.get(url)
    api_response.raise_for_status()
    repo_info = api_response.json()
    return repo_info

@task
def get_contributors(repo_info: dict):
    """Get contributors for a repo"""
    contributors_url = repo_info["contributors_url"]
    response = httpx.get(contributors_url)
    response.raise_for_status()
    contributors = response.json()
    return contributors

@flow(log_prints=True)
def log_repo_info(repo_owner: str = "PrefectHQ", repo_name: str = "prefect"):
    """
    Given a GitHub repository, logs the number of stargazers
    and contributors for that repo.
    """
    repo_info = get_repo_info(repo_owner, repo_name)
    print(f"Stars 🌠 : {repo_info['stargazers_count']}")

    contributors = get_contributors(repo_info)
    print(f"Number of contributors 👷: {len(contributors)}")

if __name__ == "__main__":
    log_repo_info()
@kavvkon kavvkon added the bug Something isn't working label Nov 18, 2024
@zzstoatzz
Copy link
Collaborator

hi @kavvkon - thanks for the issue. Do you have any rules that would prevent websocket traffic? also do you see anything about the EventsWorker still processing items?

I think this is likely a duplicate of this issue

@kavvkon
Copy link
Author

kavvkon commented Nov 19, 2024

Yes that should be it. The prefect server is hosted in another PC in intranet, (not through https). But I am in a corporate network and there are some restrictions. Any idea how to bypass and ignore SSL related errors ?

@kavvkon
Copy link
Author

kavvkon commented Nov 19, 2024

This code works btw

import asyncio

from prefect.events.clients import PrefectEventsClient

async def main():
    async with PrefectEventsClient() as client:
        print(f"Connected to: {client._events_socket_url}")
        pong = await client._websocket.ping()
        pong_time = await pong
        print(f"Response received in: {pong_time}")

if __name__ == '__main__':
    asyncio.run(main())
Connected to: ws://192.168.1.10:4200/api/events/in
Response received in: 0.0025052999990293756

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