Skip to content

Unable to upload a file to Parse-Server version 2.2.24 and above via Parse-Dashboard #3327

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

Closed
grassland-curing-cfa opened this issue Jan 5, 2017 · 4 comments

Comments

@grassland-curing-cfa
Copy link

Issue Description

[DELETE EVERYTHING ABOVE THIS LINE BEFORE SUBMITTING YOUR ISSUE]

I am with the latest version of Parse-Dashboard that is deployed to Heroku. I have also had a few Parse-Server instances of various versions running on Heroku. I noted that I was unable to upload a file to a Parse-Server version 2.2.24 and above via the Parse-Dashboard. I use Amazon S3 for file storage.

The following messages were logged on Heroku while the file uploading was attempted to a Parse-Server with version 2.2.24 or 2.2.25.

Jan 06 10:00:13 {APP_NAME_ON_HEROKU} heroku/router: at=info method=OPTIONS path="/parse/files/MY_FILE.jpg" host={APP_NAME_ON_HEROKU}.herokuapp.com request_id=e2e6f10a-99ce-4b93-a94d-9a7ed8f0ca41 fwd="183.78.173.3" dyno=web.1 connect=1ms service=4ms status=204 bytes=278

Jan 06 10:00:15 {APP_NAME_ON_HEROKU} heroku/router: at=info method=POST path="/parse/files/MY_FILE.jpg" host={APP_NAME_ON_HEROKU}.herokuapp.com request_id=2de8a8c6-fed6-498f-9bd8-c2dbb897a08c fwd="183.78.173.3" dyno=web.1 connect=2ms service=1137ms status=403 bytes=466

However, it was working well when I tried to upload the same file via a cURL command.

curl -X POST -H "X-Parse-Application-Id: {APP_ID}" -H "X-Parse-Master-Key: {MASTER_KEY}" -H "Content-Type: image/jpeg" --data-binary '@MY_FILE.jpg' https://{APP_NAME_ON_HEROKU}.herokuapp.com/parse/files/MY_FILE.jpg

The file was successfully uploaded to my Amazon S3 bucket.

[FILL THIS OUT]

Steps to reproduce

Please include a detailed list of steps that reproduce the issue. Include curl commands when applicable.

  1. Have a Parse-Server-Example dyno ready on Heroku with Parse-Server version 2.2.24 or 2.2.25
  2. Configure Amazon S3 with the Parse-Server-Example instance
  3. Have a Parse-Dashboard dyno ready on Heroku
  4. Log onto the Parse-Dashboard and create a new table with a File type field
  5. Click the File field to upload an image file and check the Heroku log for details

Expected Results

The file was uploaded to Parse Dashboard.

Actual Outcome

The file failed to upload.

Environment Setup

  • Server

    • parse-server version (Be specific! Don't say 'latest'.) : 2.2.24 or 2.2.25
    • Operating System: Windows 7
    • Hardware: DELL Laptop
    • Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): Heroku
  • Database

    • MongoDB version: 3.0
    • Storage engine: Amazon S3
    • Hardware: mLab Shared Cluster
    • Localhost or remote server? (AWS, mLab, ObjectRocket, Digital Ocean, etc): mLab
@apersaud
Copy link

apersaud commented Jan 6, 2017

Can you verify you have configured Parse-Server with a javascriptKey and provided that same javascript key when launching the Parse Dashboard?

@grassland-curing-cfa
Copy link
Author

grassland-curing-cfa commented Jan 9, 2017

Thanks @apersaud .

I have set up the javascriptKey in index.js on the Parse-server on Heroku.
...
javascriptKey: process.env.JAVASCRIPT_KEY || '',
...

How can I configure the javascriptKey for the Dashboard?

@apersaud
Copy link

apersaud commented Jan 9, 2017

You can create a config.json (as explained here) with the javascriptKey when you launch the parse-dashboard:

config.json:

{
  "apps": [
    {
     "serverURL": "http://localhost:1337/parse",
      "appId": "myAppId",
      "masterKey": "myMasterKey",
      "javascriptKey": "yourJavascriptKey",
      "appName": "MyApp"
    }
  ]
}

Then:

    $ parse-dashboard --config config.json

@natanrolnik
Copy link
Contributor

Closing this as duplicate of parse-community/parse-dashboard#480, as it makes more sense to be there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants