Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PFFile fails to save from iOS SDK 1.12.0 on parse-server 2.1.3 #675

Closed
chriscborg opened this issue Feb 26, 2016 · 2 comments
Closed

PFFile fails to save from iOS SDK 1.12.0 on parse-server 2.1.3 #675

chriscborg opened this issue Feb 26, 2016 · 2 comments
Labels
type:question Support or code-level question

Comments

@chriscborg
Copy link
Contributor

Just got this error message from iOS SDK

[Error]: Could not store file. (Code: 130, Version: 1.12.0)

The feature was working but stopped since I updated to the latest version. Unfortunately I don't have more information about the error yet cause parse-server isn't logging anything unusual. Below are dependencies I'm using:

screen shot 2016-02-26 at 9 46 40 am

I am also using the S3 adapter to upload files. In my main app.js file I have

var S3Adapter = require('parse-server').S3Adapter;
var s3Adapter = new S3Adapter('XXXXX', 'XXXXXX', {
  bucket: "img-images",
  region: "xxxxxx"
});

var api = new ParseServer({
  databaseURI: 'mongodb://xxx:xxxx@localhost:27017/xxx',
  cloud: appRoot + '/parse_cloud/main.js', // Provide an absolute path
  appId: 'xxx',
  masterKey: 'xxxxxx',
  filesAdapter: s3Adapter,
  serverURL: 'http://localhost:1337/parse',
  push: {
    ios: [
      {
        pfx: appRoot + '/apns_cert/apns-dev-key.p12', // Dev PFX or P12
        bundleId: 'com.xxx.xxxxx',
        production: false // Dev
      },
      {
        pfx: appRoot + '/apns_cert/apns-pro-key.p12', // Prod PFX or P12
        bundleId: 'com.xxx.xxxxxxx',
        production: true // Prod
      }
    ]
  }
});

Any ideas what could be wrong? Don't know if it could be related to issue #136. Thanks

@nlutsenko
Copy link
Contributor

Hey @vioside, looks like we don't fully expose the error on saving Files when using any provider - referenced in #661. I would recommend double checking your setup, but this said, I think if we do expose them - it would help you debug the issue.
Also would be a great help in debugging - simply logging the error in place which #661 highlights and putting it here.

@chriscborg
Copy link
Contributor Author

Ok so I exposed the error as highlighted in #661 and I got more information. The error was Could not store file: InvalidParameterType: Expected params.Bucket to be a string (Code: 130, Version: 1.12.0)

Maybe the way we configure S3 has changed somewhere and now, instead of passing an object with bucket and region in the parameters, we just need to pass the bucket name like so:

var s3Adapter = new S3Adapter('XXXXX', 'XXXXXX', bucket: "[bucket name]");

Now the upload is working again! Thanks again for the pointers @nlutsenko I'm saved :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:question Support or code-level question
Projects
None yet
Development

No branches or pull requests

4 participants