bitrise-steplib / steps-ios-auto-provision-appstoreconnect

MIT License
15 stars 16 forks source link

This repo suffer the same issue with mac device id #38

Closed mackoj closed 3 years ago

mackoj commented 3 years ago

Troubleshooting

Useful information

Issue description

The issue is that when you have a device of type mac here https://developer.apple.com/account/resources/devices/list it fails to register it properly.

A similar issue exist here https://github.com/bitrise-steplib/steps-ios-auto-provision/issues/140

Bitrise info

+------------------------------------------------------------------------------+
| (0) ios-auto-provision-appstoreconnect@1                                     |
+------------------------------------------------------------------------------+
| id: ios-auto-provision-appstoreconnect                                       |
| version: 1.0.0                                                               |
| collection: https://github.com/bitrise-io/bitrise-steplib.git                |
| toolkit: go                                                                  |
| time: 2021-02-04T16:35:23Z                                                   |
+------------------------------------------------------------------------------+
|                                                                              |
Config:
- BitriseConnection: automatic
- APIKeyPath: *****
- APIIssuer: [REDACTED]
- ProjectPath: SKVideo.xcworkspace
- Scheme: SKVideo
- Configuration: Release
- Distribution: development
- MinProfileDaysValid: 0
- CertificateURLList: [REDACTED]
- CertificatePassphraseList: *****
- KeychainPath: /Users/vagrant/Library/Keychains/login.keychain
- KeychainPassword: *****
- VerboseLog: false
- BuildAPIToken: [REDACTED]
- BuildURL: https://app.bitrise.io/build/79dfad8520e50930
Creating AppstoreConnectAPI client
Bitrise Apple Developer Connection with API key found
the client created for https://api.appstoreconnect.apple.com/
Analyzing project
configuration: Release
project team ID: [REDACTED]
bundle IDs:
- archery.storify
platform: iOS
Downloading certificates
2 certificates downloaded:
- Apple Development: ci mojo ([REDACTED])
- Apple Distribution: Archery Inc. ([REDACTED])
ensuring codesigning files for distribution types: [development]
Checking if 3 Bitrise test device(s) are registered on Developer Portal
53 devices are registered on Developer Portal
checking if the device ([REDACTED]) is registered
registering device
Failed to register device: POST https://api.appstoreconnect.apple.com/v1/devices: 409
- ENTITY_ERROR.ATTRIBUTE.INVALID: An attribute in the provided entity has invalid value: An invalid value '[REDACTED]' was provided for the parameter 'udid'.
|                                                                              |
+---+---------------------------------------------------------------+----------+
| x | ios-auto-provision-appstoreconnect@1 (exit code: 1)           | 24.68 sec|
+---+---------------------------------------------------------------+----------+
| Issue tracker: ...se-steplib/steps-ios-auto-provision-appstoreconnect/issues |
| Source: ...thub.com/bitrise-steplib/steps-ios-auto-provision-appstoreconnect |
+---+---------------------------------------------------------------+----------+
  
Checking if 3 Bitrise test device(s) are registered on Developer Portal
53 devices are registered on Developer Portal
checking if the device ([REDACTED]) is registered
registering device
Failed to register device: POST https://api.appstoreconnect.apple.com/v1/devices: 409
- ENTITY_ERROR.ATTRIBUTE.INVALID: An attribute in the provided entity has invalid value: An invalid value '[REDACTED]' was provided for the parameter 'udid'.

Steps to reproduce

I think the issue is due to this https://github.com/bitrise-steplib/steps-ios-auto-provision-appstoreconnect/blob/2f8484733d293df6c193984c9591e99742b9089f/main.go#L559

If we could remove all UUID that are in error from conn.TestDevices it might solve the issue.

Because with only removing the error checking it crash.

panic: runtime error: slice bounds out of range [5:4] [recovered]
    panic: runtime error: slice bounds out of range [5:4]

When I dump the content of devices I see only iOS devices as expected so why does it try to register mac devices ?

53 devices are registered on Developer Portal
checking if the device ([REDACTED]) is registered
registering device
Failed to register iOS device: POST https://api.appstoreconnect.apple.com/v1/devices: 409
- ENTITY_ERROR.ATTRIBUTE.INVALID: An attribute in the provided entity has invalid value: An invalid value '[REDACTED]' was provided for the parameter 'udid'.
mackoj commented 3 years ago

@mjones-droid, @bitce can someone please give this a look it is a blocking issue for us.

Thanks,

mjones-droid commented 3 years ago

Hey @mackoj. For the time being I've linked this issue to the other one internally. I may have to split it into a second issue, but for now it feels like a single bug affecting two steps.

I'll let you know as we get more details.

mackoj commented 3 years ago

Thanks @mjones-droid I will continue tu add details here as things progress.

mackoj commented 3 years ago

If I go around registering the "bad" udid it crash later.

panic: runtime error: slice bounds out of range [5:4] [recovered]
    panic: runtime error: slice bounds out of range [5:4]
goroutine 1 [running]:
github.com/bitrise-steplib/steps-ios-auto-provision-appstoreconnect/vendor/howett.net/plist.(*Encoder).Encode.func1(0xc00018c6c0)
    /var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise-go-toolkit067560937/src/github.com/bitrise-steplib/steps-ios-auto-provision-appstoreconnect/vendor/howett.net/plist/encode.go:29 +0xd4
panic(0x13af120, 0xc0002d5700)
    /usr/local/Cellar/go/1.15.5/libexec/src/runtime/panic.go:969 +0x1b9
github.com/bitrise-steplib/steps-ios-auto-provision-appstoreconnect/vendor/howett.net/plist.(*textPlistGenerator).plistQuotedString(0xc000159180, 0xc00188ce94, 0xe, 0xc000344034, 0xc000344037)
    /var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise-go-toolkit067560937/src/github.com/bitrise-steplib/steps-ios-auto-provision-appstoreconnect/vendor/howett.net/plist/text_generator.go:42 +0x62f
github.com/bitrise-steplib/steps-ios-auto-provision-appstoreconnect/vendor/howett.net/plist.(*textPlistGenerator).writePlistValue(0xc000159180, 0x145e4c0, 0xc0008476e0)
    /var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise-go-toolkit067560937/src/github.com/bitrise-steplib/steps-ios-auto-provision-appstoreconnect/vendor/howett.net/plist/text_generator.go:134 +0xed3
github.com/bitrise-steplib/steps-ios-auto-provision-appstoreconnect/vendor/howett.net/plist.(*textPlistGenerator).writePlistValue(0xc000159180, 0x145d780, 0xc0006d6ae0)
    /var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise-go-toolkit067560937/src/github.com/bitrise-steplib/steps-ios-auto-provision-appstoreconnect/vendor/howett.net/plist/text_generator.go:116 +0xdd8
github.com/bitrise-steplib/steps-ios-auto-provision-appstoreconnect/vendor/howett.net/plist.(*textPlistGenerator).writePlistValue(0xc000159180, 0x145d780, 0xc0008fe4e0)
    /var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise-go-toolkit067560937/src/github.com/bitrise-steplib/steps-ios-auto-provision-appstoreconnect/vendor/howett.net/plist/text_generator.go:116 +0xdd8
github.com/bitrise-steplib/steps-ios-auto-provision-appstoreconnect/vendor/howett.net/plist.(*textPlistGenerator).writePlistValue(0xc000159180, 0x145d780, 0xc0008fe480)
    /var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise-go-toolkit067560937/src/github.com/bitrise-steplib/steps-ios-auto-provision-appstoreconnect/vendor/howett.net/plist/text_generator.go:116 +0xdd8
github.com/bitrise-steplib/steps-ios-auto-provision-appstoreconnect/vendor/howett.net/plist.(*textPlistGenerator).generateDocument(0xc000159180, 0x145d780, 0xc0008fe480)
    /var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise-go-toolkit067560937/src/github.com/bitrise-steplib/steps-ios-auto-provision-appstoreconnect/vendor/howett.net/plist/text_generator.go:28 +0x3f
github.com/bitrise-steplib/steps-ios-auto-provision-appstoreconnect/vendor/howett.net/plist.(*Encoder).Encode(0xc00018c6d8, 0x13a3a20, 0xc0001e4240, 0x0, 0x0)
    /var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise-go-toolkit067560937/src/github.com/bitrise-steplib/steps-ios-auto-provision-appstoreconnect/vendor/howett.net/plist/encode.go:50 +0x254
github.com/bitrise-steplib/steps-ios-auto-provision-appstoreconnect/vendor/howett.net/plist.MarshalIndent(0x13a3a20, 0xc0001e4240, 0x3, 0x0, 0x0, 0x2, 0x2, 0x0, 0x0, 0x0)
    /var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise-go-toolkit067560937/src/github.com/bitrise-steplib/steps-ios-auto-provision-appstoreconnect/vendor/howett.net/plist/encode.go:122 +0xaa
github.com/bitrise-steplib/steps-ios-auto-provision-appstoreconnect/vendor/howett.net/plist.Marshal(...)
    /var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise-go-toolkit067560937/src/github.com/bitrise-steplib/steps-ios-auto-provision-appstoreconnect/vendor/howett.net/plist/encode.go:113
github.com/bitrise-steplib/steps-ios-auto-provision-appstoreconnect/vendor/github.com/bitrise-io/xcode-project/xcodeproj.XcodeProj.savePBXProj(0xc00187f542, 0x18, 0xc00187f91b, 0x18, 0xc0018a7b95, 0x7, 0xc000432410, 0x2, 0x2, 0xc00062a300, ...)
    /var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise-go-toolkit067560937/src/github.com/bitrise-steplib/steps-ios-auto-provision-appstoreconnect/vendor/github.com/bitrise-io/xcode-project/xcodeproj/xcodeproj.go:492 +0x65
github.com/bitrise-steplib/steps-ios-auto-provision-appstoreconnect/vendor/github.com/bitrise-io/xcode-project/xcodeproj.XcodeProj.Save(...)
    /var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise-go-toolkit067560937/src/github.com/bitrise-steplib/steps-ios-auto-provision-appstoreconnect/vendor/github.com/bitrise-io/xcode-project/xcodeproj/xcodeproj.go:487
main.main()
    /var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise-go-toolkit067560937/src/github.com/bitrise-steplib/steps-ios-auto-provision-appstoreconnect/main.go:725 +0x29a5
lpusok commented 3 years ago

Hello @mackoj, We released an updated version 1.0.1 (https://discuss.bitrise.io/t/ios-auto-provision-with-app-store-connect-api-v1-0-1/15906) that fixes the issue. Mac type devices are not supported yet, but they no longer cause errors. Please open a new issue in case you experience any problems with the fix.