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

Files are not found on 4.3.0 #6881

Closed
4 tasks done
Samigos opened this issue Aug 24, 2020 · 7 comments
Closed
4 tasks done

Files are not found on 4.3.0 #6881

Samigos opened this issue Aug 24, 2020 · 7 comments
Labels
type:question Support or code-level question

Comments

@Samigos
Copy link

Samigos commented Aug 24, 2020

New Issue Checklist

Issue Description

I updated my server from 2.8.4 to 4.3.0 and I immediately realized that none of the images loaded anymore. (the images are stored in mongo)

I dug in the fs.files and fs.chunks and I saw that all files are intact! So with the @davimacedo's suggestion, I downgraded to 4.2.0 and now everything works fine!

This is my server setup;

var api = new ParseServer({
    databaseURI: databaseUri || 'mongodb://',
    cloud: './cloud-code-repository/main.js',
    appId: process.env.APP_ID || '' ,
    masterKey: process.env.MASTER_KEY || '' ,
    fileKey: 'b5528d30-...',

    serverURL: process.env.SERVER_URL || 'http://ip:1337/parse' , 
    liveQuery: {
       classNames: ['Message', 'ChatRoom'] // List of classes to support for query subscriptions
    },

    publicServerURL: 'http://ip:1337/parse'
});

Environment

Server

  • Parse Server version: 4.3.0
  • Operating system: Ubuntu 18.04.1
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): Digital Ocean

Database

  • System (MongoDB or Postgres): MongoDB
  • Database version: 4.0.2
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): Digital Ocean

Client

  • SDK (iOS, Android, JavaScript, PHP, Unity, etc): iOS & Android

Logs

0|index  | Error: Unsupported state or unable to authenticate data
0|index  |     at Decipheriv.final (crypto.js:183:26)
0|index  |     at GridFSBucketReadStream.stream.on (/root/parse-server-example/node_modules/parse-server/lib/Adapters/Files/GridFSBucketAdapter.js:113:78)
0|index  |     at emitNone (events.js:106:13)
0|index  |     at GridFSBucketReadStream.emit (events.js:208:7)
0|index  |     at endReadableNT (_stream_readable.js:1064:12)
0|index  |     at args.(anonymous function) (/usr/local/lib/node_modules/pm2/node_modules/event-loop-inspector/index.js:138:29)
0|index  |     at _combinedTickCallback (internal/process/next_tick.js:139:11)
0|index  |     at process._tickDomainCallback (internal/process/next_tick.js:219:9)
@dplewis
Copy link
Member

dplewis commented Aug 25, 2020

@cbaker6 Can you have a look at this? I think its an issue with #6765

@cbaker6
Copy link
Contributor

cbaker6 commented Aug 25, 2020

In parse-server 4.3 since fileKey: 'b5528d30-... is present when initializing the ParseServer, it’s attempting to decrypt the files with that key. Removing fileKey should fix the issue.

If you want to encrypt the files with a fileKey, see the details in the PR @dplewis referenced.

@Samigos
Copy link
Author

Samigos commented Aug 27, 2020

In parse-server 4.3 since fileKey: 'b5528d30-... is present when initializing the ParseServer, it’s attempting to decrypt the files with that key. Removing fileKey should fix the issue.

If you want to encrypt the files with a fileKey, see the details in the PR @dplewis referenced.

So it should be removed altogether?

@cbaker6
Copy link
Contributor

cbaker6 commented Aug 27, 2020

@Samigos yes (or comment out and save for later), fileKey the way you are using it is legacy parse.com. The aforementioned PR repurposed the use of fileKey as it wasn't being used by parse server anymore up to 4.2. I think what I mentioned about legacy parse is in the parse documentation somewhere...

@Samigos Samigos closed this as completed Aug 27, 2020
@davimacedo
Copy link
Member

@dplewis @TomWFox @mtrezza Should we mention that somewhere in the release notes and/or docs? It is actually a breaking change.

@mtrezza
Copy link
Member

mtrezza commented Aug 31, 2020

Agree, this should be in the docs.

@TomWFox
Copy link
Contributor

TomWFox commented Sep 1, 2020

Seems like it should be in the release notes at least.

@mtrezza mtrezza added type:question Support or code-level question and removed 🔧 troubleshooting labels Jul 11, 2021
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

6 participants