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

Something went wrong while running badge #55

Closed
Bierrot opened this issue Jul 28, 2017 · 8 comments
Closed

Something went wrong while running badge #55

Bierrot opened this issue Jul 28, 2017 · 8 comments

Comments

@Bierrot
Copy link

Bierrot commented Jul 28, 2017

Hi,

when I run badge through fastlane, I've got this error :

Something went wrong while running badge: `identify /var/folders/62/dklrzf_d1z79pwbykyv57kdc0000gp/T/mini_magick20170728-84089-1iz3pf1.png` failed with error:
identify: improper image header `/var/folders/62/dklrzf_d1z79pwbykyv57kdc0000gp/T/mini_magick20170728-84089-1iz3pf1.png' @ error/png.c/ReadPNGImage/4126.

On my fastfile i've got this :

badge(shield:get_version_number + “-” + get_build_number + “-blue”, custom: “fastlane/badge/black/dev.png”, shield_no_resize:true)

Don't know what to do. Thank's for helping.

@nommis
Copy link

nommis commented Aug 3, 2017

I'm getting the same error, any idea @HazAT ? Thanks

@wolfe719
Copy link

We have gotten this error intermittently as well. One suggestion was that my image_magick install might not be the latest (it was not - but updating to the latest via brew did not fix this issue).

I use Fastlane to call the badge function, which uses a mini_magick gem (v4.5.1) to add two badges at the top of the application icons. This combination works most of the time (9 out of 10 times?)

Sometimes, though, the combination produces a failure in parsing what looks like an intermediate PNG. My latest theory is that some combination of the mini_magick gem (v4.5.1) and the badge gem (v0.8.4) might be trying to start a subsequent operation before a previous operation completes?

Here is the rather cryptic and less than totally helpful error message I get:

Something went wrong while running badge: identify /var/folders/57/dhl6f07524q0ygmthfjz4n1h0000gn/T/mini_magick20170812-34515-gelu3n.png failed with error:
identify: improper image header `/var/folders/57/dhl6f07524q0ygmthfjz4n1h0000gn/T/mini_magick20170812-34515-gelu3n.png' @ error/png.c/ReadPNGImage/4232.

@sergii-frost
Copy link

Getting exactly same behaviour.

Can't update to the latest version of mini_magick (which is 4.8.0) while using bundle, as getting an error like:

Bundler could not find compatible versions for gem "mini_magick":
  In Gemfile:
    mini_magick (= 4.8.0)

    badge (= 0.8.4) was resolved to 0.8.4, which depends on
      mini_magick (>= 4.5)

    badge (= 0.8.4) was resolved to 0.8.4, which depends on
      fastlane (>= 2.0) was resolved to 2.47.0, which depends on
        mini_magick (~> 4.5.1)

@rafalwojcik
Copy link
Contributor

I have the same problem and it happens only sometimes. I try to recognize what raise it and shields.io sometimes respond to image request with a server error, I don't remember error code but it was something like 400 or 500. Then this is saved as png, so image magic can't resize something that is HTML file instead of png. So I think we should add checking request-response and if it is bad then try to repeat request by few times after that if it does not respond correctly then raise an error with right message instead of this unknown error. I will try to do it now and create PR for that.

@rafalwojcik
Copy link
Contributor

rafalwojcik commented Aug 21, 2017

Ok I recognize error. shields.io respond sometimes with success code 200 and body:

<!doctype html><meta charset=utf-8><title>A server error occurred</title>
<h1> I have nothing to offer for this request </h1>
<p> � but blood, toil, tears and sweat.
</p>
<p>And trying again later.</p>

So probably we need to check after download if downloaded file is image and if isn't then try to download one more time

@rafalwojcik
Copy link
Contributor

rafalwojcik commented Aug 21, 2017

PR created, also added a way to specify the number of retry times after download problem. Default 10 times. @HazAT

@HazAT
Copy link
Owner

HazAT commented Aug 22, 2017

This should be fixed with version 0.8.5 thx @rafalwojcik

@HazAT HazAT closed this as completed Aug 22, 2017
@salmojunior
Copy link

I'm using 0.8.5 version but I'm still facing this issue but it is intermittent.

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

7 participants