uppy icon indicating copy to clipboard operation
uppy copied to clipboard

OneDrive Business/Family authentication bad gateway

Open stackbomb opened this issue 6 months ago • 1 comments

Initial checklist

  • [x] I understand this is a bug report and questions should be posted in the Community Forum
  • [x] I searched issues and couldn’t find anything (or linked relevant results below)

Link to runnable example

No response

Steps to reproduce

Hi I'm getting the bad gateway for OneDrive accounts with paid plans (Microsoft 365), while on the free OneDrive accounts everything is working fine.

I'm running companion behind a load balancer in docker containers and it's working perfectly for GoogleDrive/OneDrive (free accounts)/local uploads except for this nasty edge case. Any ideas why it's happening?

package.json

  "dependencies": {
    "@uppy/companion": "^6.1.0",
    "express": "^4.18.2",
    "body-parser": "^1.20.2",
    "express-session": "^1.17.3"
  },

Dockerfile

FROM node:18-alpine

# Create app directory
WORKDIR /usr/src/app

# Install app dependencies
COPY package*.json ./
RUN npm install --production

# Copy app source
COPY . .

# Create data directory
RUN mkdir -p /mnt/uppy-server-data

# Expose port
EXPOSE 3020

# Run the app
CMD ["node", "index.js"]

docker-compose.yml

version: '3.8'

services:
  uppy-companion-app:
    build: .
    container_name: uppy-companion-app
    ports:
      - 127.0.0.1:3020:3020
    env_file:
      - .env
    logging:
      driver: "json-file"
      options:
        max-size: "10m"
        max-file: "3"
    volumes:
      - /tmp/uppy-server-data:/mnt/uppy-server-data
    restart: unless-stopped

index.js from https://github.com/transloadit/uppy/blob/main/examples/companion/server/index.js

Expected behavior

Successful authentication as for free OneDrive accounts and redirect back to my application after getting the token.

Actual behavior

uppy-companion-app    | companion: 2025-10-09T16:47:12.035Z [info] token.verify.unset cannot auth token

And bad gateway page shown.

What I don't understand is that on the same paid account I'm able to authenticate successfully on https://uppy.io/examples/

Could be something related to https://github.com/transloadit/uppy/issues/2045 ?

stackbomb avatar Oct 09 '25 21:10 stackbomb

thanks for posting this, I'm stuck on the same exact problem

cppntn avatar Oct 10 '25 10:10 cppntn