bugsnag/bugsnag-dsym-upload

upload_symbols_to_bugsnag only works for me when I add the version and build code

tastafur opened this issue ยท 8 comments

Describe the bug

upload_symbols_to_bugsnag only works for me when I add the version and build code. I ended up having some huge versions 1.8.151445

upload_symbols_to_bugsnag is only based on getting the app version, it should be able to work using the build version

Captura de pantalla 2021-03-16 a las 10 09 13

Steps to reproduce

if I upload the dsym like this, it generally doesn't work.
The UUID of the dsym appears to me uploaded but the dsym of the version that I just uploaded appears to me without uploading

download_dsyms(version: ENV["VERSION"], build_number: ENV["VERSION_CODE"], wait_for_dsym_processing: true)       # Download dSYM files from iTC
upload_symbols_to_bugsnag

If I do it like this it usually works

download_dsyms(version: ENV["VERSION"] + ENV["VERSION_CODE"], build_number: ENV["VERSION_CODE"], wait_for_dsym_processing: true)       # Download dSYM files from iTC
upload_symbols_to_bugsnag

Environment

  • fastlane:
    • fastlane version: 2.178.0

Hey @tastafur, based on some of your events, I can see that your versioning seems to work as follows:

  • app.version: a.b.cZ where Z is the version code.
  • app.versionCode: Z, and equals the Z in the app.version above.

So, this aligns with why your second command using ..version: ENV["VERSION"] + ENV["VERSION_CODE"].. works, but ..version: ENV["VERSION"].. does not, as you need to concatenate the version and version code.

Bugsnag matches dSYMs to each frame in the stack trace using the UUID only, it does not use the app version, or version code as it's possible to have the same dSYM for multiple versions of your app so long as the binary relating to the dSYM does not change (e.g. a library in your app). If the codebase changes, then so will the UUID, so this is sufficient for matching. To this end, I don't believe there's any bug, or need to change the upload_symbols_to_bugsnag action. The download_dsyms Fastlane action is a native Fastlane action that's not maintained by Bugsnag, but I don't think there's any bug here either, it's working as expected as far as I can see.

To move this forward, we need to work out whether the versioning as described is intentional or not? If it is, then you can continue to download your dSYMs using the snippet you've provided. If it isn't, you'll need to look into your app versioning to work out why the version code is being appended to your app version.

Hello @xander-jones,
I with the code where I only use the version when I upload `, many times the dsym fails and as you said before it finds a dsym that could be worth it and here it happened but at the moment of truth then it is not valid, it is not able to use it but if I take and use the versioning as I have told you version + bundleVersion if it usually works. Now I attach logs and screenshots where you see that I download the dsym 1.1.0 and your plugin is supposed to upload it but it finds supposed dsym files that should be worth it but then at the moment of truth it tells me that for version 1.1 .0 the dsym is lost because the plugin thinks that it should not put the dsym that I downloaded. And then how can you see your platform when there is an error it cannot find it even though I have downloaded that dsym and tried to upload it to your platform.

INFO [2021-03-15 13:22:39.51]: Waiting for dSYM file to appear...
DEBUG [2021-03-15 13:23:10.18]: dsym_url: http://iosapps.itunes.apple.com/itunes-assets/Purple114/v4/da/4d/c9/da4dc99c-fa44-b88c-a501-12b41af99de0/appDsyms.zip?accessKey=1616008990_8017754984393970019_aKjsOHw4pGiN9lKcv0DqdHAittsk17zup8TTtSQk4%2FTqWfZjQ39fL39EC0GglFAgQInwZc5PUX4Vkfj8kPIIEDadD3X%2FYyXiBPjdxZ9CH0H72e1PWKR6zA6Pnns%2BFo7ebaJ%2FFIZgbcaBXSgE2R24M0q60y50jqYmIW99wSMDWZg%3D
INFO [2021-03-15 13:23:11.14]: ๐Ÿ”‘ Successfully downloaded dSYM file for 1.1.0 - 1823 to 'com.dotipps.app-1.1.0-1823.dSYM.zip'
DEBUG [2021-03-15 13:23:11.15]: Most recent build uploaded_date 2021-03-15T06:12:23-07:00
DEBUG [2021-03-15 13:23:11.15]: Found train (version): 1.0.131785 , comparing to supplied version: 1.1.0
DEBUG [2021-03-15 13:23:11.15]: Version 1.1.0 doesn't match: 1.0.131785
DEBUG [2021-03-15 13:23:11.15]: Found train (version): 1.0.131758 , comparing to supplied version: 1.1.0
DEBUG [2021-03-15 13:23:11.15]: Version 1.1.0 doesn't match: 1.0.131758
DEBUG [2021-03-15 13:23:11.15]: Found train (version): 1.0.131767 , comparing to supplied version: 1.1.0
DEBUG [2021-03-15 13:23:11.15]: Version 1.1.0 doesn't match: 1.0.131767
DEBUG [2021-03-15 13:23:11.15]: Found train (version): 1.0.131730 , comparing to supplied version: 1.1.0
DEBUG [2021-03-15 13:23:11.15]: Version 1.1.0 doesn't match: 1.0.131730
DEBUG [2021-03-15 13:23:11.15]: Found train (version): 1.0.131712 , comparing to supplied version: 1.1.0
DEBUG [2021-03-15 13:23:11.15]: Version 1.1.0 doesn't match: 1.0.131712
DEBUG [2021-03-15 13:23:11.15]: Found train (version): 1.0.131696 , comparing to supplied version: 1.1.0
DEBUG [2021-03-15 13:23:11.15]: Version 1.1.0 doesn't match: 1.0.131696
DEBUG [2021-03-15 13:23:11.15]: Found train (version): 1.0.131654 , comparing to supplied version: 1.1.0
DEBUG [2021-03-15 13:23:11.15]: Version 1.1.0 doesn't match: 1.0.131654
DEBUG [2021-03-15 13:23:11.15]: Found train (version): 1.0.121637 , comparing to supplied version: 1.1.0
DEBUG [2021-03-15 13:23:11.15]: Version 1.1.0 doesn't match: 1.0.121637
DEBUG [2021-03-15 13:23:11.15]: Found train (version): 1.0.121606 , comparing to supplied version: 1.1.0
DEBUG [2021-03-15 13:23:11.15]: Version 1.1.0 doesn't match: 1.0.121606
DEBUG [2021-03-15 13:23:11.15]: Found train (version): 1.0.121591 , comparing to supplied version: 1.1.0
DEBUG [2021-03-15 13:23:11.15]: Version 1.1.0 doesn't match: 1.0.121591
DEBUG [2021-03-15 13:23:11.15]: Found train (version): 1.0.111482 , comparing to supplied version: 1.1.0
DEBUG [2021-03-15 13:23:11.15]: Version 1.1.0 doesn't match: 1.0.111482
DEBUG [2021-03-15 13:23:11.15]: Found train (version): 1.0.101321 , comparing to supplied version: 1.1.0
DEBUG [2021-03-15 13:23:11.15]: Version 1.1.0 doesn't match: 1.0.101321
DEBUG [2021-03-15 13:23:11.15]: Found train (version): 1.0.91295 , comparing to supplied version: 1.1.0
DEBUG [2021-03-15 13:23:11.15]: Version 1.1.0 doesn't match: 1.0.91295
DEBUG [2021-03-15 13:23:11.15]: Found train (version): 1.0.81274 , comparing to supplied version: 1.1.0
DEBUG [2021-03-15 13:23:11.15]: Version 1.1.0 doesn't match: 1.0.81274
DEBUG [2021-03-15 13:23:11.15]: Found train (version): 1.0.71256 , comparing to supplied version: 1.1.0
DEBUG [2021-03-15 13:23:11.15]: Version 1.1.0 doesn't match: 1.0.71256
DEBUG [2021-03-15 13:23:11.15]: Found train (version): 1.0.71212 , comparing to supplied version: 1.1.0
DEBUG [2021-03-15 13:23:11.15]: Version 1.1.0 doesn't match: 1.0.71212
DEBUG [2021-03-15 13:23:11.15]: Found train (version): 1.0.71153 , comparing to supplied version: 1.1.0
DEBUG [2021-03-15 13:23:11.15]: Version 1.1.0 doesn't match: 1.0.71153
DEBUG [2021-03-15 13:23:11.15]: Found train (version): 1.0.61101 , comparing to supplied version: 1.1.0
DEBUG [2021-03-15 13:23:11.15]: Version 1.1.0 doesn't match: 1.0.61101
DEBUG [2021-03-15 13:23:11.15]: Found train (version): 1.0.51026 , comparing to supplied version: 1.1.0
DEBUG [2021-03-15 13:23:11.15]: Version 1.1.0 doesn't match: 1.0.51026
DEBUG [2021-03-15 13:23:11.15]: Found train (version): 1.0.4946 , comparing to supplied version: 1.1.0
DEBUG [2021-03-15 13:23:11.15]: Version 1.1.0 doesn't match: 1.0.4946
DEBUG [2021-03-15 13:23:11.15]: Found train (version): 1.0.3924 , comparing to supplied version: 1.1.0
DEBUG [2021-03-15 13:23:11.15]: Version 1.1.0 doesn't match: 1.0.3924
DEBUG [2021-03-15 13:23:11.15]: Found train (version): 1.0.2901 , comparing to supplied version: 1.1.0
DEBUG [2021-03-15 13:23:11.15]: Version 1.1.0 doesn't match: 1.0.2901
DEBUG [2021-03-15 13:23:11.15]: Found train (version): 1.0.1871 , comparing to supplied version: 1.1.0
DEBUG [2021-03-15 13:23:11.15]: Version 1.1.0 doesn't match: 1.0.1871
DEBUG [2021-03-15 13:23:11.15]: Found train (version): 1.0.0829 , comparing to supplied version: 1.1.0
DEBUG [2021-03-15 13:23:11.15]: Version 1.1.0 doesn't match: 1.0.0829
DEBUG [2021-03-15 13:23:11.15]: Found train (version): 0.1.5672 , comparing to supplied version: 1.1.0
DEBUG [2021-03-15 13:23:11.15]: Version 1.1.0 doesn't match: 0.1.5672
DEBUG [2021-03-15 13:23:11.15]: Found train (version): 0.1.4657 , comparing to supplied version: 1.1.0
DEBUG [2021-03-15 13:23:11.16]: Version 1.1.0 doesn't match: 0.1.4657
DEBUG [2021-03-15 13:23:11.16]: Found train (version): 0.1.3639 , comparing to supplied version: 1.1.0
DEBUG [2021-03-15 13:23:11.16]: Version 1.1.0 doesn't match: 0.1.3639
DEBUG [2021-03-15 13:23:11.16]: Found train (version): 0.1.2611 , comparing to supplied version: 1.1.0
DEBUG [2021-03-15 13:23:11.16]: Version 1.1.0 doesn't match: 0.1.2611
DEBUG [2021-03-15 13:23:11.16]: Found train (version): 0.1.1589 , comparing to supplied version: 1.1.0
DEBUG [2021-03-15 13:23:11.16]: Version 1.1.0 doesn't match: 0.1.1589
DEBUG [2021-03-15 13:23:11.16]: Found train (version): 0.0.2457 , comparing to supplied version: 1.1.0
DEBUG [2021-03-15 13:23:11.16]: Version 1.1.0 doesn't match: 0.0.2457
DEBUG [2021-03-15 13:23:11.16]: Found train (version): 0.0.2417 , comparing to supplied version: 1.1.0
DEBUG [2021-03-15 13:23:11.16]: Version 1.1.0 doesn't match: 0.0.2417
DEBUG [2021-03-15 13:23:11.16]: Found train (version): 0.0.2384 , comparing to supplied version: 1.1.0
DEBUG [2021-03-15 13:23:11.16]: Version 1.1.0 doesn't match: 0.0.2384
DEBUG [2021-03-15 13:23:11.16]: Found train (version): 0.0.2307 , comparing to supplied version: 1.1.0
DEBUG [2021-03-15 13:23:11.16]: Version 1.1.0 doesn't match: 0.0.2307
DEBUG [2021-03-15 13:23:11.16]: Found train (version): 0.0.2285 , comparing to supplied version: 1.1.0
DEBUG [2021-03-15 13:23:11.16]: Version 1.1.0 doesn't match: 0.0.2285
DEBUG [2021-03-15 13:23:11.16]: Found train (version): 0.0.2246 , comparing to supplied version: 1.1.0
DEBUG [2021-03-15 13:23:11.16]: Version 1.1.0 doesn't match: 0.0.2246
DEBUG [2021-03-15 13:23:11.16]: Found train (version): 0.0.2181 , comparing to supplied version: 1.1.0
DEBUG [2021-03-15 13:23:11.16]: Version 1.1.0 doesn't match: 0.0.2181
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
INFO [2021-03-15 13:23:11.93]: ---------------------------------------
INFO [2021-03-15 13:23:11.93]: --- Step: upload_symbols_to_bugsnag ---
INFO [2021-03-15 13:23:11.94]: ---------------------------------------
DEBUG [2021-03-15 13:23:11.94]: Uploading dSYMs to Bugsnag with the following parameters:
DEBUG [2021-03-15 13:23:11.94]: api_key: ********************************
DEBUG [2021-03-15 13:23:11.94]: dsym_path: ["/Users/distiller/DoTippsApps/ios/dotipps.app.dSYM.zip"]
DEBUG [2021-03-15 13:23:11.94]: upload_url:
DEBUG [2021-03-15 13:23:11.94]: symbol_maps_path:
DEBUG [2021-03-15 13:23:11.94]: project_root: /Users/distiller/DoTippsApps/ios
DEBUG [2021-03-15 13:23:11.94]: config_file: ./DoTipps/Info.plist
Uploading files to https://upload.bugsnag.com
Preparing to upload /var/folders/6y/gy9gggt14379c_k39vwb50lc0000gn/T/bugsnag-dsym-upload.XXX.z3K7EiTM/DoTipps.app.dSYM
Uploading UUID: 5EDA3449-FE6D-392A-B40F-35379CB28AD3 (armv7) /var/folders/6y/gy9gggt14379c_k39vwb50lc0000gn/T/bugsnag-dsym-upload.XXX.z3K7EiTM/DoTipps.app.dSYM/Contents/Resources/DWARF/DoTipps UUID: 2AFFF698-842C-3557-86E8-5F43169D02E3 (arm64) /var/folders/6y/gy9gggt14379c_k39vwb50lc0000gn/T/bugsnag-dsym-upload.XXX.z3K7EiTM/DoTipps.app.dSYM/Contents/Resources/DWARF/DoTipps

Preparing to upload /var/folders/6y/gy9gggt14379c_k39vwb50lc0000gn/T/bugsnag-dsym-upload.XXX.z3K7EiTM/NotificationServiceExtension.appex.dSYM
Uploading UUID: 13A803EA-A98D-32BF-B35C-A3ECD1601751 (armv7) /var/folders/6y/gy9gggt14379c_k39vwb50lc0000gn/T/bugsnag-dsym-upload.XXX.z3K7EiTM/NotificationServiceExtension.appex.dSYM/Contents/Resources/DWARF/NotificationServiceExtension UUID: 9DD07217-316E-3DEE-9395-40DAA332A6EF (arm64) /var/folders/6y/gy9gggt14379c_k39vwb50lc0000gn/T/bugsnag-dsym-upload.XXX.z3K7EiTM/NotificationServiceExtension.appex.dSYM/Contents/Resources/DWARF/NotificationServiceExtension

2 files uploaded successfully
INFO [2021-03-15 13:23:14.53]: Uploaded dSYMs in /Users/distiller/DoTippsApps/ios/dotipps.app.dSYM.zip
INFO [2021-03-15 13:23:14.53]: Successfully generated documentation at path '/Users/distiller/DoTippsApps/ios/fastlane/README.md'

Captura de pantalla 2021-03-16 a las 15 55 35
Captura de pantalla 2021-03-16 a las 16 01 05
Captura de pantalla 2021-03-16 a las 15 56 34

Hi @tastafur, looks like download_dsyms is downloading the .zip as com.dotipps.app-1.1.0-1823.dSYM.zip, but you're uploading /Users/distiller/DoTippsApps/ios/dotipps.app.dSYM.zip, unless you're doing some renaming along the way, looks like you're uploading the wrong .zip here.

By default the dsym_path is scraping the current level directory from dSYMs:

def self.default_dsym_path
path = Dir["./**/*.dSYM.zip"] + Dir["./**/*.dSYM"]

You can override this by defining the dsym_path in your call to upload_symbols_to_bugsnag action: https://docs.bugsnag.com/build-integrations/fastlane/#additional-configuration, or ensuring download_dsyms downloads to a space within your project directory by setting the output_directory option: https://docs.fastlane.tools/actions/download_dsyms/#parameters

Hi @xander-jones
I do this

def refreshDsyms()
  download_dsyms(version: ENV["VERSION"], build_number: ENV["VERSION_CODE"], wait_for_dsym_processing: true)       # Download dSYM files from iTC
  upload_symbols_to_bugsnag
end

I do not renaming or anything, it would be nice if apart from scraping the url the version could be passed to it and the build seen as seen, this can happen that takes a dsym without naming.

I'm going to find out if it is renamed or what it does because if it sounds to me that the download_dsym library creates a file without a version in the naming but keeps the version somewhere

Hi @xander-jones
I have been seeing the code of download_dsym puts the version and build is supposed in the patch as you say but I do not do anything else

https://github.com/fastlane/fastlane/edit/master/fastlane/lib/fastlane/actions/download_dsyms.rb

Hi @xander-jones
I have the bitcode activated when having it activated you need to generate the dsym file in the appStore but by default the projects when you generate the bundle will generate the dsym file then it had the dsym downloaded from the appStore and the dsym that the app build generated. This would cause your plugin to grab the dsym file that was not valid for both.
I have already updated it so that it does not generate it and it already works
Captura de pantalla 2021-03-22 a las 18 02 43

Hi @tastafur, good digging! Thanks for letting us know your resolution. I realize now that this was probably Fastlane overriding using the SharedValues::DSYM_OUTPUT_PATH lane context. This still feels like the right action for the tool to take, but I think it would be worth considering showing some more verbose info on how the tool is getting dSYM paths.

Hey @tastafur, https://github.com/bugsnag/bugsnag-dsym-upload/releases/tag/v2.2.0 contains a fix which I believe should resolve the issue that you were seeing :)