MobileNativeFoundation / XCLogParser

Tool to parse Xcode and xcodebuild logs stored in the xcactivitylog format
Apache License 2.0
1.72k stars 121 forks source link

HTML parser is not working anymore #108

Closed AyaAkl25 closed 3 years ago

AyaAkl25 commented 3 years ago

Hey There, I don't know what happened but out of nowhere after everything was working and the html page generated was showing all the errors and logs, now whenever I try to generate with html parser the html page is generated but displays empty data then the html page just breaks and does not want to load anymore.

I tried the following approaches

xclogparser parse --file pathtologfile.xcactivitylog --reporter html xclogparser parse --workspace pathtoworkspacefile.xcworkspace --reporter html xclogparser parse --project mytaxi --reporter html

any clue why this might be happening? my Xcode version is 11.5 xclogparser version: XCLogParser 0.2.18 and I am sure we are using Swift5

Thank you

polac24 commented 3 years ago

Hi! You mention that html reporter is broken. Does that mean for other reporters (like --reporter flatJson), the log is parsed correctly? Does the generated in the output directoryjs/build.js contain any log data?

im-ling commented 3 years ago

Hi! You mention that html reporter is broken. Does that mean for other reporters (like --reporter flatJson), the log is parsed correctly? Does the generated in the output directoryjs/build.js contain any log data?

same problem, --reporter flatJson seems fine, js/build.js contains log data 20200925113843.zip

Environment: macOS Catalina 10.15.6 Xcode Version 11.7 (11E801a) language: swift5

AyaAkl25 commented 3 years ago

Hi! You mention that html reporter is broken. Does that mean for other reporters (like --reporter flatJson), the log is parsed correctly? Does the generated in the output directoryjs/build.js contain any log data?

@polac24 as far as I can see from my terminal output when I try --reporter flatJson is working fine and js/build.js contains the logs data but it is 3 GB (almost 4GB)

also I got to try the json reporter and it was working as well

polac24 commented 3 years ago

3GB js/build.js is definitely too big to load in a browser. Please open the file and scan which elements are duplicated, most likely duplicated entries cause 4GB filesize. If you can share your .xcactivitylog, that would be helpful too.

xyreryp commented 3 years ago

Hi team,

I am running into the same issue.

XCLogParser 0.2.19
Xcode Version 11.5 (11E608c)
OS Version 10.15.6(19G2021)
Swift 5

Our js/build.js is 594.1 MB and contains log data. And this is what the index.html looks like image

xyreryp commented 3 years ago

So I got the fix.(kind of) @AyaAkl25 @polac24 @im-ling

I got the blank html page if I ran the command below in the xcactivitylog folder.

xclogparser parse --file {id}.xcactivitylog --reporter html --output reports/

However, if I ran the command below. It will generate the correct HTML and *.js files. And if I opened the HTML file in Chrome, it will crash. But if I open the HTML file in Safari, it will show the correct content.

 xclogparser parse --project MyApp --reporter html --output reports/
AyaAkl25 commented 3 years ago

3GB js/build.js is definitely too big to load in a browser. Please open the file and scan which elements are duplicated, most likely duplicated entries cause 4GB filesize. If you can share your .xcactivitylog, that would be helpful too.

Unfortunately I won't be able to share the .xcactivitylog file but I am checking fir the duplicate entries.. Not sure yet why this file is starting to be that big

AyaAkl25 commented 3 years ago

So I got the fix.(kind of) @AyaAkl25 @polac24 @im-ling

I got the blank html page if I ran the command below in the xcactivitylog folder.

xclogparser parse --file {id}.xcactivitylog --reporter html --output reports/

However, if I ran the command below. It will generate the correct HTML and *.js files. And if I opened the HTML file in Chrome, it will crash. But if I open the HTML file in Safari, it will show the correct content.

 xclogparser parse --project MyApp --reporter html --output reports/

Still same issue with me even from Safari :(

ecamacho commented 3 years ago

Hi, @xyreryp @AyaAkl25 can you use Chrome to get the error? Open the html in it, right click on it and choose "Inspect" to open the developer console. Reload the page and check the Console tab for any Javascript error:

image

AyaAkl25 commented 3 years ago

Hi, @xyreryp @AyaAkl25 can you use Chrome to get the error? Open the html in it, right click on it and choose "Inspect" to open the developer console. Reload the page and check the Console tab for any Javascript error:

image

I tried that and no errors show up at all, I think the html page tries to show the data but because if the size of the log file, it cannot complete. but so far no idea why the file is so big like that. It worked before

AyaAkl25 commented 3 years ago

So I deleted all the files and everything and tried to generate the html report again, now the size is back to normal but still does not want to load any data then the page breaks

thedavidharris commented 3 years ago

Thisi is the error we have in console

image

AyaAkl25 commented 3 years ago

Hey guys, any help or clues on this?

hc-almeida commented 3 years ago

I also have the same problem. for some reason the html works on safari, but it shows a warning that the report is taking up a lot of memory. Maybe that's why google chrome breaks.

ecamacho commented 3 years ago

@AyaAkl25 @hc-almeida can you help me check the size of the json file? It's located in the folder called js inside where the index.html is created. The name of the file is build.js Also, do you generate Swift Type Check stats (building with the option -debug-time-expression-type-checking? We also have issues displaying the HTML when we generate them.

AyaAkl25 commented 3 years ago

@AyaAkl25 @hc-almeida can you help me check the size of the json file? It's located in the folder called js inside where the index.html is created. The name of the file is build.js Also, do you generate Swift Type Check stats (building with the option -debug-time-expression-type-checking? We also have issues displaying the HTML when we generate them.

so the build.js file it is almost 4GB, when it is like 5,6MB everything seems fine. I tried to look for duplicated entries but so far I didn't find any. No we don't build with -debug-time-expression-type-checking option

I have a question, like at Spotify, normally what is the size of the build.js and does it happen that sometimes this logs file gets so big?

Thank you

ecamacho commented 3 years ago

@AyaAkl25 that's really big. I was checking ours and in the worst case it's ~145MB. Do you have too many targets or files in your project? Are you using something like Cocoapods with a lot of dependencies?

AyaAkl25 commented 3 years ago

so about targets, I tried multiple of schemes that has different numbers of targets (high and low) and same result of big size file. about Cocoapods, yes we do use it and I believe with lots of dependencies, is there a way I can solve this out?

ecamacho commented 3 years ago

I think the solution is to not use the full json for the HTML report, it's actually not needed. I will try to work on a new version that uses a smaller json with only the data we need next week

AyaAkl25 commented 3 years ago

I think the solution is to not use the full json for the HTML report, it's actually not needed. I will try to work on a new version that uses a smaller json with only the data we need next week

Thank you so much

emesa-meli commented 3 years ago

I think the solution is to not use the full json for the HTML report, it's actually not needed. I will try to work on a new version that uses a smaller json with only the data we need next week

Thank you. Same problem here, our json is slightly more than 3gb and we had no luck rendering the html output.

sbanil commented 3 years ago

I believe it appears the size of the JSON file depends on XCLog file it is parsing. So, i was able to get size from 2GB to 150MB by turning off SwiftLint and without_build_specific_information options. I was only interested in build times so this may be ok. If you want to get count of Warnings and errors may be you want to keep SwiftLink step.

AyaAkl25 commented 3 years ago

I think the solution is to not use the full json for the HTML report, it's actually not needed. I will try to work on a new version that uses a smaller json with only the data we need next week

Hey @ecamacho are there any updates on that matter? Thank you

ecamacho commented 3 years ago

Hi @AyaAkl25 @emesa-meli @hc-almeida we just released a new version that breaks down the report to smaller files so the browser can render them. Please give it a try

chaucyzhang commented 3 years ago

what i found is the cdn website of jquery sometimes down