Sentry-java: Android proguard mapping file - Error: Missing uploaded file

Created on 6 Oct 2018  路  45Comments  路  Source: getsentry/sentry-java

[INFO] sentry_cli::api request POST https://sentry.io/api/0/projects/OrgName/ProjectName/files/dsyms/
[INFO] sentry_cli::api using token authentication
[INFO] sentry_cli::api sending form data
[INFO] sentry_cli::api > POST /api/0/projects/OrgName/ProjectName/files/dsyms/ HTTP/1.1
[INFO] sentry_cli::api > Host: sentry.io
[INFO] sentry_cli::api > Accept: /
[INFO] sentry_cli::api > Connection: TE
[INFO] sentry_cli::api > TE: gzip
[INFO] sentry_cli::api > User-Agent: sentry-cli/1.35.5
[INFO] sentry_cli::api > Authorization: Bearer a57d5458*
[INFO] sentry_cli::api > Content-Length: 228
[INFO] sentry_cli::api > Content-Type: multipart/form-data; boundary=------------------------b1d8f431c86402e9
[INFO] sentry_cli::api < HTTP/1.1 400 BAD REQUEST
[INFO] sentry_cli::api < Server: nginx
[INFO] sentry_cli::api < Date: Fri, 05 Oct 2018 23:32:07 GMT
[INFO] sentry_cli::api < Content-Type: application/json
[INFO] sentry_cli::api < Content-Length: 35
[INFO] sentry_cli::api < Connection: keep-alive
[INFO] sentry_cli::api < X-XSS-Protection: 1; mode=block
[INFO] sentry_cli::api < Content-Language: en
[INFO] sentry_cli::api < X-Content-Type-Options: nosniff
[INFO] sentry_cli::api < Vary: Accept-Language, Cookie
[INFO] sentry_cli::api < Allow: GET, POST, HEAD, OPTIONS
[INFO] sentry_cli::api < X-Frame-Options: deny
[INFO] sentry_cli::api < X-Served-By: web-17b74f97
[INFO] sentry_cli::api < Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
[INFO] sentry_cli::api response: 400
[INFO] sentry_cli::api body: {"detail": "Missing uploaded file"}
error: API request failed
caused by: sentry reported an error: Missing uploaded file (http status: 400)

Properties file:
log.level=debug
defaults.project=ProjectName
defaults.org=OrgName
auth.token=Token

(values seem ok here, not sure what can or cant publish)

proguard file:
-keepattributes LineNumberTable,SourceFile
-dontwarn org.slf4j.*
-dontwarn javax.
*
-keep class io.sentry.event.Event { *; }

Help plz.

Most helpful comment

This should be fixed in sentry-cli v1.39.1.

All 45 comments

Are you actually trying to upload the file you pasted at the bottom? That is just configuration to run ProGuard on your project (locally). You'd use that with minification enabled (in Gradle) and build an APK, and then a much larger ProGuard mappings file would be generated -- and that is what needs to be uploaded to Sentry.

Our Gradle plugin helps manage this process for you: https://docs.sentry.io/clients/java/modules/android/#gradle-integration

Uhm, nope, I posted my config, including the ProGuard config since it doc says it needs no changes on this file and somewhere else says it needs the line number and so, that's why it's there.

And yes, gradle process you mention, it's not working... any advice?

For me, it seems it's not even being generated, how can I check this?

OK, what threw me off is the error says {"detail": "Missing uploaded file"} and your request says Content-Length: 228 which is most likely not a valid ProGuard mapping file.

Is this log from the Gradle plugin or are you running it yourself? Are there any other logs at all? Is there a valid ProGuard mappings file in your project build output and if so how large is it?

Yes, it's from the plugin
Any other logs? Apparently, no.
Yes, mapping is being generated andd I have to check the size

mapping.txt -> 6322KB

Can you share your build.gradle and app/build.gradle (or equivalents)? Or at least any relevant sections about Sentry, buildTypes/variants etc?

Hello again, sorry I was on vacation :p

app gradle:
apply plugin: 'io.sentry.android.gradle'

buildTypes {
    release {
        minifyEnabled true
        shrinkResources true
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), file('proguard.pro'), file('nologs.pro')
        signingConfig signingConfigs.config
    }

lintOptions {
    tasks.lint.enabled = true
    disable 'MissingTranslation'
    abortOnError false
}

sentry {
// Disables or enables the automatic configuration of proguard
// for Sentry. This injects a default config for proguard so
// you don't need to do it manually.
autoProguardConfig true

// Enables or disables the automatic upload of mapping files
// during a build.  If you disable this you'll need to manually
// upload the mapping files with sentry-cli when you do a release.
autoUpload true

}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
........
implementation 'io.sentry:sentry-android:1.7.10'
implementation 'org.slf4j:slf4j-nop:1.7.25'
}

and also the classpath on root gradle file: classpath 'io.sentry:sentry-android-gradle-plugin:1.7.10'

Can you upload or email the entire DEBUG log? I'm curious if the sentry-cli ever identifies what file it's actually uploading (the one that's apparently only 228 bytes) to help debug why that file is being selected.

Alternatively I wonder if you could print args here in a local build of the Gradle plugin? We should log that or something I suppose.

email sent

any feedback? thanks.

We need to print the args to sentry-cli to figure out what file path it's trying to upload that's so small. I guess it must not do this by default with DEBUG enabled.

@mitsuhiko or @jan-auer maybe you have input on whether it'd be easy to change sentry-cli to print the args it was invoked with at the DEBUG level?

I'm adding something for that.

Awesome, I have no idea what your release schedule is like but I'll include it whenever a release is cut.

Hey @einschneidend can you use 1.7.13 with SENTRY_LOG_LEVEL=debug and post the logs?

https://github.com/getsentry/sentry-java/releases/tag/v1.7.13

Hi, I don't see the args, I'm assuming _log.level=debug_ on the properties file is the same
_as SENTRY_LOG_LEVEL=debug_, email sent.

Did you upgrade the Gradle plugin version to 1.7.13 also? Or just the Sentry SDK itself?

oh, my bad, 2nd run.

Bad news ( actually good news ), it worked this time : ( :) )
email sent

Checked the site and file is there.

Very odd. So you're good for now? I guess bump this if you are able to reproduce?

sure, thanks a lot!

Fix was to update the lib.

I have this error too with 1.7.13

Can you run with SENTRY_LOG_LEVEL=debug and post your logs?

Same as @einschneidend

Task :app:transformClassesAndResourcesWithProguardForBetaRelease
INFO 2018-11-01 22:58:21.912996500 +03:00 Loaded config from C:Users....sentryclirc
INFO 2018-11-01 22:58:21.913996400 +03:00 sentry-cli was invoked with the following command line: "C:\Users\...\AppData\Local\Temp\.sentry-cli3711642066634943431.exe" "upload-proguard" "--android-manifest" "C:\...\app\bui
ld\intermediates\merged_manifests\betaRelease\processBetaReleaseManifest\merged\AndroidManifest.xml" "--write-properties" "C:\...\app\build/intermediates/assets/beta/release/sentry-debug-meta.properties" "C:\...\app\build\outputs\mapping\beta\release\mapping.txt"
compressing mappings
uploading mappings
DEBUG 2018-11-01 22:58:22.193195500 +03:00 request POST https://sentry.io/api/0/projects/.../files/dsyms/
DEBUG 2018-11-01 22:58:22.193195500 +03:00 using token authentication
DEBUG 2018-11-01 22:58:22.193195500 +03:00 sending form data
DEBUG 2018-11-01 22:58:22.962078 +03:00 > POST /api/0/projects/.../files/dsyms/ HTTP/1.1
DEBUG 2018-11-01 22:58:22.962078 +03:00 > Host: sentry.io
DEBUG 2018-11-01 22:58:22.962078 +03:00 > Accept: /
DEBUG 2018-11-01 22:58:22.962078 +03:00 > Connection: TE
DEBUG 2018-11-01 22:58:22.962078 +03:00 > TE: gzip
DEBUG 2018-11-01 22:58:22.962078 +03:00 > User-Agent: sentry-cli/1.36.3
DEBUG 2018-11-01 22:58:22.963070600 +03:00 > Authorization: Bearer ...
DEBUG 2018-11-01 22:58:22.963070600 +03:00 > Content-Length: 228
DEBUG 2018-11-01 22:58:22.963070600 +03:00 > Content-Type: multipart/form-data; boundary=------------------------04cd73b97b52e858
DEBUG 2018-11-01 22:58:23.320256800 +03:00 < HTTP/1.1 400 BAD REQUEST
DEBUG 2018-11-01 22:58:23.320256800 +03:00 < Server: nginx
DEBUG 2018-11-01 22:58:23.320256800 +03:00 < Date: Thu, 01 Nov 2018 19:58:22 GMT
DEBUG 2018-11-01 22:58:23.320256800 +03:00 < Content-Type: application/json
DEBUG 2018-11-01 22:58:23.320256800 +03:00 < Content-Length: 35
DEBUG 2018-11-01 22:58:23.320256800 +03:00 < Connection: keep-alive
DEBUG 2018-11-01 22:58:23.320256800 +03:00 < X-XSS-Protection: 1; mode=block
DEBUG 2018-11-01 22:58:23.320256800 +03:00 < Content-Language: en
DEBUG 2018-11-01 22:58:23.320256800 +03:00 < X-Content-Type-Options: nosniff
DEBUG 2018-11-01 22:58:23.320256800 +03:00 < Vary: Accept-Language, Cookie
DEBUG 2018-11-01 22:58:23.320256800 +03:00 < Allow: GET, POST, DELETE, HEAD, OPTIONS
DEBUG 2018-11-01 22:58:23.320256800 +03:00 < X-Frame-Options: deny
DEBUG 2018-11-01 22:58:23.320256800 +03:00 < X-Served-By: web-c9683d4c
DEBUG 2018-11-01 22:58:23.320256800 +03:00 < Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
DEBUG 2018-11-01 22:58:23.334255500 +03:00 response: 400
DEBUG 2018-11-01 22:58:23.334255500 +03:00 body: {"detail": "Missing uploaded file"}
DEBUG 2018-11-01 22:58:23.336256600 +03:00 skipping update nagger because session is not attended
error: API request failed
caused by: sentry reported an error: Missing uploaded file (http status: 400)
DEBUG 2018-11-01 22:58:23.338258 +03:00 client close; no transport to shut down (from sentry)

What's the size of "C:\...\app\build\outputs\mapping\beta\release\mapping.txt"? Or did Sentry actually output that path? I'm assuming you elided it.

Yes, I elided the path, but it's correct. Actual file size is 4,03 MB (4聽233聽256 bytes)

OK weird, if that path is a file that exists that is 4MB then this is probably @mitsuhiko or @jan-auer territory.

any word on this? i got the same issue, gradle plugin version is 1.7.15, the file is generated and is at the correct path, file size: 12MB, on windows 10

I think this will require a fix in sentry-cli, as it seems like the file has a good size and correct path? @mitsuhiko @jan-auer

well they don't seem to be active :)

@nicusorflorin I suppose when you pass --require-one it fails with error: found no mapping files to upload instead?
Also, what are the contents of sentry-debug-meta.properties after the command ran?

It would be great if you could send an archive containing your android manifest and the mapping.txt to jan.[email protected]. Thanks!

The same issue; also, I've tried to execute the sentry-cli command manually, the same error.
I'm not sure, but probably this is a windows related issue.
Plugin version 1.7.20

@jan-auer I've sent you all these files by email.

Thank you, I will take a look today.

I have the same problem - works sometimes, others not

Perhaps its when the there are no newly uploaded debug symbols?

We were able to reproduce the issue on Windows and will land a fix soon.
Ref https://github.com/getsentry/sentry-cli/pull/484

This should be fixed in sentry-cli v1.39.1.

Thanks, this seem to have fixed the upload problems I was having with the plugin.

Should the Gradle plugin be updated as well?
I still get the error, suppose Gradle plugin uses old version of sentry-cli?

@olsh I am running with a local build of the plugin due to another issue. So I supply my own cli exe.
https://github.com/getsentry/sentry-java/issues/667

I think there is a way to configure your release plugin build to use a custom cli exe. See the docs.

@ayavilevich thanks for the reply! 馃憤
I didn't find a way to configure the plugin with a custom version of CLI.
I suppose that the version should be updated here

@jan-auer any chance that the plugin will be updated as well?

Also, it seems like the doc is outdated and suggests to use the old version of the plugin.

@olsh yes, update in that sh script or download manually and put in the resources/bin folder.

Released 1.7.21 with newer sentry-cli

Was this page helpful?
0 / 5 - 0 ratings