Skip to content
This repository has been archived by the owner on May 22, 2021. It is now read-only.

Immediate upload failure (something went wrong page) #1513

Open
cmerola opened this issue Aug 14, 2020 · 9 comments
Open

Immediate upload failure (something went wrong page) #1513

cmerola opened this issue Aug 14, 2020 · 9 comments

Comments

@cmerola
Copy link

cmerola commented Aug 14, 2020

I got this up and running fairly quickly from the docs and insight from https://ahmedmusaad.com/self-hosting-firefox-send/, however, when it comes to uploading documents, it instantly fails to the /error page as soon as I click upload - all other file stats display correctly. My hunch is that it's storage related, though tmk I thought it was suppose to default to local storage. All seems fine except for the upload portion.

This is what the web console shows:
TypeError: Cannot convert undefined or null to object at Function.keys (<anonymous>) at Object.pruneTokens (storage.js:213) at new <anonymous> (storage.js:38) at Object.<anonymous> (storage.js:228) at o (bootstrap:63) at Module.<anonymous> (metrics.js:1) at o (bootstrap:63) at Module.<anonymous> (app.f2f95a8e.js:29) at o (bootstrap:63) at Object.<anonymous> (app.f2f95a8e.js:29) pruneTokens @ storage.js:223
image

My Env:

  • OS: Ubuntu 18.04.5 LTS
  • ubuntu@ip-172-31-32-195:/opt/send$ npm -v && nodejs -v
  • npm v6.14.6
  • nodejs v12.18.3
  • Used "sudo docker-compose up -d", got nginx proxy working, lets encrypt, etc..
  • Running Config: config.js.zip

Any ideas? Permissions Related? I can't locate a log file, so if someone could point that out as well, that'd be awesome.

Thanks in advance!

@drum7
Copy link

drum7 commented Aug 19, 2020

I have this exact same issue both running as a normal npm app and as a container.

@okyanusoz
Copy link

okyanusoz commented Aug 23, 2020

OK. I found a solution. Open server/config.js in any editor and change this line:

fxa_required: { format: Boolean, default: true, env: 'FXA_REQUIRED' },
to:

fxa_required: { format: Boolean, default: false, env: 'FXA_REQUIRED' },

@okyanusoz
Copy link

okyanusoz commented Aug 23, 2020

It worked for me

@drum7
Copy link

drum7 commented Aug 23, 2020

Me too - How'd you find the fix? Someone else posted a new 401 error with that as an ENV variable. Couldn't find it in the docs, but I'm sure that's just b/c i'm skimming. It also makes sense since they're changing how the service can be used to mandate auth...

@okyanusoz
Copy link

okyanusoz commented Aug 23, 2020

Well, let me explain, take a look at this code where the 401 error occurs:

if (config.fxa_required && !user) { ws.send( JSON.stringify({ error: 401 }) ); return ws.close(); }(taken from https://github.com/mozilla/send/blob/master/server/routes/ws.js)


So, it checks if a FXA(Firefox Account) is required and if the client is not authenticated, it gives an error.


In the configuration, Firefox Accounts are required by default but you need a client ID for that and we don't have any.


That's why this happens.

@drum7
Copy link

drum7 commented Aug 23, 2020

Well, let me explain, take a look at this code where the 401 error occurs:

if (config.fxa_required && !user) { ws.send( JSON.stringify({ error: 401 }) ); return ws.close(); }(taken from https://github.com/mozilla/send/blob/master/server/routes/ws.js)

So, it checks if a FXA(Firefox Account) is required and if the client is not authenticated, it gives an error.

In the configuration, Firefox Accounts are required by default but you need a client ID for that and we don't have any.

That's why this happens.

With you - except where I saw the error in my console was...I think storage.js or something weird, leading me to think it was some undocumented storage req. I also could be remembering wrong so will have to play a bit later... You just tried to submit something and then watched the console?

In any event...thank you!

@okyanusoz
Copy link

I looked at the network activity and saw the 401 error

@cmerola
Copy link
Author

cmerola commented Aug 28, 2020

Thanks @okyanusoz! Excited to try it out.

@ioistired
Copy link

I tried setting the environment variable FXA_REQUIRED to false (which is the format convict expects for boolean env vars) and it didn't help.

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

No branches or pull requests

4 participants