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

Immediate upload failure (something went wrong page) #1513

Open

Description

@cmerola

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!

Activity

  1. drum7 commented on Aug 19, 2020

    @drum7

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

  2. okyanusoz commented on Aug 23, 2020

    @okyanusoz

    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' },

  3. okyanusoz commented on Aug 23, 2020

    @okyanusoz

    It worked for me

  4. drum7 commented on Aug 23, 2020

    @drum7

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

  5. okyanusoz commented on Aug 23, 2020

    @okyanusoz

    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.

  6. drum7 commented on Aug 23, 2020

    @drum7

    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!

  7. okyanusoz commented on Aug 23, 2020

    @okyanusoz

    I looked at the network activity and saw the 401 error

  8. cmerola commented on Aug 28, 2020

    @cmerola
    Author

    Thanks @okyanusoz! Excited to try it out.

  9. ioistired commented on Sep 9, 2020

    @ioistired

    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 join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions