GithubHelp home page GithubHelp logo

Comments (3)

jiangbin0814 avatar jiangbin0814 commented on May 25, 2024

first of all,if u export it as txt,it might cause this problem, maybe u can try export it as zip and then take the bugreport from it, it works for me,and ihope it will work for u too

from battery-historian.

JosielManzonni avatar JosielManzonni commented on May 25, 2024

As other people have reported I also get errors when analyzing Android 10 bugreports. Note: Could not parse aggregated battery stats.

I then pulled and ran googles latest image 3.1, and it does indeed work with Android 10 bugreports. So after this, I tried extracting all the files from the image and running it myself. These are commands I use (I use Ubuntu):

//Create new container
 docker create  --name="bh" -p 80:80 --expose=80 gcr.io/android-battery-historian/stable:3.1

 //Copy all files from container to current local folder
 docker cp bh:/gopure/src/github.com/google/battery-historian $PWD

I then ran setup.go and then battery-historian.go. The application launched but I still get the same error, "Could not parse aggregated battery stats."

With the same source I have also tried building my own docker image with the following dockerfile:

 #Use latest golang:alpine version which is smaller than regular golang.
FROM golang:1.12.5-alpine3.9

#Get the battery historian code from local code commit repo
WORKDIR /go/src/codecommit/battery-historian
COPY . /go/src/codecommit/battery-historian

#Install Java, git and python and cleanup after in the same layer.
RUN apk update && \
    apk add openjdk8-jre git python2 && \
    rm -rf /var/cache/apk/*

#Install dependencies recursively and remove the third_party directory after it has been used for compiling.
RUN go get ./... &&  \
    go run setup.go

#Open default port
EXPOSE 80

#Run the start file for battery historian in a container.
CMD go run cmd/battery-historian/battery-historian.go --port 80

But when I use this image, I still get the same error as before.

What are I and Google doing differently?

Someone fix it properly ? All recent issues is about it. I have the same problem here, I got docker 3.0 cp from container to local and run then I got the error, but running from docker it work, does not make sense.

from battery-historian.

nomis avatar nomis commented on May 25, 2024

This is the change in the Google v3.1 docker image that gets rid of that error:

diff --git a/checkinparse/checkin_parse.go b/checkinparse/checkin_parse.go
index d8d6fcb..89fa14f 100644
--- a/checkinparse/checkin_parse.go
+++ b/checkinparse/checkin_parse.go
@@ -589,10 +589,7 @@ func ParseBatteryStats(pc checkinutil.Counter, cr *checkinutil.BatteryReport, pk
 		// Parse csv lines according to
 		// frameworks/base/core/java/android/os/BatteryStats.java.
 		parsed, warn, csErrs := parseSection(pc, reportVersion, rawUID, section, remaining, stats, system, apkSeen, &allAppComputedPowerMah)
-		e := false
-		if e, warnings, errs = saveWarningsAndErrors(warnings, warn, errs, csErrs...); e {
-			return nil, warnings, errs
-		}
+		_, warnings, errs = saveWarningsAndErrors(warnings, warn, errs, csErrs...)
 		if !parsed {
 			warnings = append(warnings, fmt.Sprintf("unknown data category %s", section))
 		}

from battery-historian.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.