viewtube icon indicating copy to clipboard operation
viewtube copied to clipboard

Occasional 401 on /api

Open sdfg2 opened this issue 3 years ago • 1 comments

Describe the Bug

Occasionally, there will be an error doing something, such as going to profile or subscriptions. Checking the browser console shows that when this happens there is always a 401 for the /api path relating to where I was trying to go. This was happening frequently on :0.9, switching to :dev reduced it drastically but it still happens.

Steps to Reproduce the Bug

It's not predictably reproducible. I've noticed it clicking on profile or subscriptions, but that's all I've done with viewtube so far.

Expected Behaviour

The page loads without errors.

Device Info

  • Device: desktop
  • OS: I use Arch btw ;-)
  • Browser: Firefox and Vivaldi
  • Version: latest

Additional Context

Might be related to #1114?

docker-compose.yml

version: "3"

services:
  viewtube:
    container_name: viewtube
    restart: unless-stopped
    image: mauriceo/viewtube:dev
    depends_on:
      - viewtube-mongodb
      - viewtube-redis
    networks:
      - viewtube
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ./data:/data
    environment:
      - VIEWTUBE_URL=http://localhost:8066
      - VIEWTUBE_DATABASE_HOST=viewtube-mongodb
      - VIEWTUBE_REDIS_HOST=viewtube-redis
      - VIEWTUBE_DATA_DIRECTORY=/data
    ports:
      - 8066:8066

  viewtube-mongodb:
    container_name: viewtube-mongodb
    image: mongo:4.4
    networks:
      - viewtube
    restart: unless-stopped
    volumes:
      - ./data/db:/data/db

  viewtube-redis:
    container_name: viewtube-redis
    image: redis:6
    networks:
      - viewtube
    restart: unless-stopped
    volumes:
      - ./data/redis:/data

networks:
  viewtube:

sdfg2 avatar Mar 15 '22 22:03 sdfg2

Just been setting up a proper domain name for it to see if it was something to do with that, and in the course of watching a video for testing I saw that the errors were coming in occasionally relating to the history, I guess when it was trying to save the progress:

312ce76.modern.js:2          POST http://vt.heracles.lan/api/user/history/iQGl-ffVtaM 401 (Unauthorized)
(anonymous) @ 312ce76.modern.js:2
t.exports @ 312ce76.modern.js:2
t.exports @ 312ce76.modern.js:2
Promise.then (async)
v.request @ 312ce76.modern.js:2
r.forEach.v.<computed> @ 312ce76.modern.js:2
(anonymous) @ 312ce76.modern.js:2
Pe @ d6239a8.modern.js:1
(anonymous) @ d6239a8.modern.js:1
setInterval (async)
onVideoPlaying @ d6239a8.modern.js:1
ee @ 312ce76.modern.js:2
n @ 312ce76.modern.js:2
Dr.c._wrapper @ 312ce76.modern.js:2

sdfg2 avatar Mar 15 '22 23:03 sdfg2

I'm not getting this anymore. I think it may have been to do with not adding the 172.16/12 address space to the nginx ACL.

sdfg2 avatar Nov 06 '22 10:11 sdfg2