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

How to load the snapshot properly? #2

Open
minhtran83 opened this issue Sep 14, 2024 · 7 comments
Open

How to load the snapshot properly? #2

minhtran83 opened this issue Sep 14, 2024 · 7 comments

Comments

@minhtran83
Copy link

First of all, I would like to thank you for a great tooling. I am trying to load the mini / full snapshot file locally but I am not able
image
But it is like to request the end point from src/main/java/com/coekie/flowtracker/web/TreeResource.java

What is the best way to run WebModule with a snapshot file?

Thanks,
Minh

@coekie
Copy link
Owner

coekie commented Sep 14, 2024

Browsing a snapshot does not require running any java code (such as TreeResource or WebModule), because the snapshot should already contain their result.
I don't know why you're getting a 404 there. Does your snapshot zip not contain a tree/all file?

And I don't know what that error in globalShims.js is about, that file does not look familiar. Is that perhaps coming from a Chrome extension?
Can you try looking at the snapshot in an incognito window (where extensions are disabled) to see if that helps?

@coekie
Copy link
Owner

coekie commented Sep 14, 2024

And that http://[::]:8000/tree/all URL looks weird: where does that [::] come from?
Are you using jwebserver and looking at http://localhost:... like in the USAGE.md instructions, or are you doing something different?

@minhtran83
Copy link
Author

minhtran83 commented Sep 14, 2024

Thanks for reply @coekie. I was firstly running it using python httpserver
I just did that again with jwebserver and here is the log and screenshot
image

[14:49:54][~/Downloads/snapshot]
➜  ~/.sdkman/candidates/java/21.0.4-oracle/bin/jwebserver
Binding to loopback by default. For all interfaces use "-b 0.0.0.0" or "-b ::".
Serving /Users/<xxx>/.Trash/snapshot and subdirectories on 127.0.0.1 port 8000
URL http://127.0.0.1:8000/
127.0.0.1 - - [14/Sept/2024:14:50:04 +0700] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [14/Sept/2024:14:50:04 +0700] "GET /tree/all HTTP/1.1" 404 -

@coekie
Copy link
Owner

coekie commented Sep 14, 2024

The snapshot should always contain a tree/all file, but looks like it doesn't. Maybe it crashed partly through generating the snapshot zip file.
Was there no error printed to the console when running the java program?

@minhtran83
Copy link
Author

@coekie I don't see any special log.
I use -javaagent:XXX... to pass through my Tomcat web app to run it.
Then I accessed http://localhost:8011/snapshot/minimized or http://localhost:8011/snapshot/full to download snapshot
Can you help me link the code to include tree/all file? I can open a PR if possible

@minhtran83
Copy link
Author

Let me debug to this part to find out https://github.com/coekie/flowtracker/blob/master/web/src/main/java/com/coekie/flowtracker/web/Snapshot.java#L101

@minhtran83
Copy link
Author

I am still unsure why the snapshot does not execute the above line to write out the tree/all I will try to add log to find out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants