cloudinary_ios icon indicating copy to clipboard operation
cloudinary_ios copied to clipboard

CredStore - Error copying matching creds

Open barclayd opened this issue 4 years ago • 13 comments

Bug report for Cloudinary iOS SDK

Describe the bug in a sentence or two.

When uploading an unsigned image, I receive a debug console message detailing a CredStore performQuery error. This occurs on every upload. When the uploadImage is executed, the error message is printed to the debug console. In most cases, the upload is still successful, in spite of the error message

Issue Type (Can be multiple)

[ ] Build - Can’t install or import the SDK [ ] Performance - Performance issues [ ] Behaviour - Functions aren’t working as expected (Such as generate URL) [ ] Documentation - Inconsistency between the docs and behaviour [x] Debug error

Steps to reproduce

import Cloudinary
import Foundation

class ImageService {
    static let shared = ImageService()

    private lazy var config: CLDCloudinary = {
        let config = CLDConfiguration(cloudName: API.cloudName)
        let cloudinary = CLDCloudinary(configuration: config)
        return cloudinary
    }()

    public func uploadImage(publicId: String, imageData: Data) {
        let params = CLDUploadRequestParams().setUploadPreset(API.cloudName).setPublicId(publicId).setFolder(API.folder)

        config.createUploader().upload(data: imageData, uploadPreset: API.uploadPreset, params: params) { response, _ in
            if let cloudinaryImage = response?.secureUrl {
                print(cloudinaryImage)
            }
        }
    }
}

Error screenshots or Stack Trace (if applicable)

CredStore - performQuery - Error copying matching creds.  Error=-50, query={
    "m_Limit" = "m_LimitAll";
    ptcl = htps;
    srvr = "api.cloudinary.com";
    sync = syna;
}

Build/Dependency management

[ ] Cocoa-Pods [ ] Carthage [ ] Manual import [x] SPM

Is the issue reproducible only on a specific device?

[x] No [ ] Yes (specify model + iOS version)

Versions and Libraries (fill in the version numbers)

iOS Cloudinary SDK version - 2.9.0 OSX (on the dev environment) - 10.14.6 XCode - 11.3.1 Swift - 5.2 Target iOS - 13.3

barclayd avatar Jun 26 '20 11:06 barclayd

@barclayd Can you please let us know if this is happening in your code or in the sample app?

michalkcloudinay avatar Jun 29 '20 11:06 michalkcloudinay

@michalkcloudinay This is occurring within my code using the code snippet provided in the issue

barclayd avatar Jun 29 '20 11:06 barclayd

@barclayd we opened a request to our dev team to fix this issue. however, since it's not a blocker and the upload is working. there is no ETA yet. we will update you with any insights.

shirlymanor avatar Jul 01 '20 16:07 shirlymanor

Thanks very much @shirlymanor!

barclayd avatar Jul 01 '20 17:07 barclayd

Hi, any news about this bug, it also happening in the example.

giancar70 avatar Nov 17 '20 16:11 giancar70

Hi! For me the upload isn't successful after getting this same error. Please let me know how to get the file upload working.

Update: Tried with SDK version 2.8.0 and it worked. Looks like the upload isn't working properly in the latest version 2.9.0

CORRECTION: I later found that the upload was in fact working even though the error was appearing in the logs upon calling upload method.

r-a-o avatar Nov 22 '20 22:11 r-a-o

Hi @r-a-o, In order to further investigate your issue can you please share your code? If privacy is a concern please feel free to open a support ticket at [email protected]

michalkcloudinay avatar Nov 23 '20 15:11 michalkcloudinay

Hi @r-a-o ! Try adding the secret key to the config initialiser like so:

let config = CLDConfiguration(cloudName: "cloudName", apiKey: "apiKey", apiSecret: "apiSecret")

Then upload as a signed upload It worked for me!

1Soyebo avatar Nov 24 '20 20:11 1Soyebo

@1Soyebo that should work, however, we are highly recommended to have the credentials on the server-side (or have unsigned upload).

shirlymanor avatar Nov 24 '20 21:11 shirlymanor

Update: I later found that the upload was in fact working even though the error was appearing in the logs upon calling upload method. Error message is a little confusing.

r-a-o avatar Dec 05 '20 17:12 r-a-o

@1Soyebo that should work, however, we are highly recommended to have the credentials on the server-side (or have unsigned upload).

Thanks for the reminder, I removed it from my app. I think this should be highlighted in the docs. Most people put this in the code on client side.

r-a-o avatar Dec 05 '20 17:12 r-a-o

@r-a-o Thanks for the feedback. I'm glad this is working for you now.

michalkcloudinay avatar Dec 06 '20 11:12 michalkcloudinay

@r-a-o @barclayd,

Can you please update to the latest version of the SDK and let me know if you are still seeing this error in the logs? Thanks

michalkcloudinay avatar Aug 28 '22 13:08 michalkcloudinay