Skip to content

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

Closed

Description

@chriscborg

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

Activity

  1. nlutsenko commented on Feb 26, 2016

    @nlutsenko
    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.

  2. chriscborg commented on Feb 26, 2016

    @chriscborg
    ContributorAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:questionSupport or code-level question

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions