7 Replies
      Latest reply on Apr 15, 2020 3:25 PM by PBK
      CitizenJohnny Level 1 Level 1 (0 points)

        Hi,

         

        It seems like iCloud is unable to create the container. I tried it on multiple device as well as the simulator. I get the below error message on all of them,

         

        ErrorHandler.Fail: Bad Container: the specified container is unknown or unauthorized.CKError.Code: 5

        ErrorHandler.Fail: Bad Container: the specified container is unknown or unauthorized.CKError.Code: 5

        ErrorHandler.Fail: Bad Container: the specified container is unknown or unauthorized.CKError.Code: 5

        ErrorHandler.partialFailure for 1 items; CKPartialErrorsByItemIDKey: {

            "<CKRecordZoneID: 0x600002c1e8a0; ownerName=__defaultOwner__, zoneName=PortraitObjectsZone>" = "<CKError 0x6000022a48d0: \"Bad Container\" (5/1014); \"Couldn't get container configuration from the server for container \"iCloud.shervin.shirazian.portrait\"\">";

        }

        ErrorHandler.Fail: Bad Container: the specified container is unknown or unauthorized.CKError.Code: 5

        ErrorHandler.Fail: Bad Container: the specified container is unknown or unauthorized.CKError.Code: 5

        ErrorHandler.Fail: Bad Container: the specified container is unknown or unauthorized.CKError.Code: 5

        ErrorHandler.Fail: Bad Container: the specified container is unknown or unauthorized.CKError.Code: 5

        • Re: CloudKit Container
          ManuelMB Level 3 Level 3 (175 points)

          This error code is:

           

          Un-provisioned or unauthorized container. Try provisioning the container before retrying the operation.

           

          Go to your proyect > Target > Capabilities > Enable ICloud > Select CloudKit > Use default container

          • Re: CloudKit Container
            PBK Level 7 Level 7 (3,765 points)

            You need to enable iCloud under the Capabilities tab of your target app.  In that you will select the container you want to use.  Chose 'Use default contaoner' as suggested by ManuelMB unless you want a custom container to be able to share data with other apps.

              • Re: CloudKit Container
                Macho Man Randy Savage Level 3 Level 3 (385 points)

                In Xcode 11.1 there is no "use default container" option as far as I can tell.  I keep getting: Bad Container" (1014); "Couldn't get container configuration from the server for container when trying to use the default container.

                 

                Using +containerWithIdentifier: and manually typing in the container id seems to work though...any way to express a given identifier as default so I can use the +defaultContainer factory?

                 

                Guess I can try to manually create the container iCloud.\(application-identifier).  No way to delete development containers, so I'll have an extra container in my dashboard later. Guess I'll just use the current identifier i have.

              • Re: CloudKit Container
                DESIGNLABSOLUTIONSEMPLOYEE Level 1 Level 1 (0 points)

                In xcode 11.1 there is no default container. You need to click add container in the capabilities section. To call the container in the code you need to write "let container = CKContainer(identifier: "the name of the container")".