memos icon indicating copy to clipboard operation
memos copied to clipboard

INFO client error method GetWorkspaceProfile

Open HT-Moh opened this issue 1 year ago • 2 comments

Describe the bug

When I host the App in my server and navigate to the domain the first time I get the error below. Normally it should please see the swarm stack. same happen for slash.

Server profile
version: 0.23.0
data: /var/opt/memos
dsn: /var/opt/memos/memos_prod.db
addr: 
port: 5230
mode: prod
driver: sqlite
---
Version 0.23.0 has been started on port 5230
---
See more in:
👉Website: https://usememos.com
👉GitHub: https://github.com/usememos/memos
---
2024/10/26 13:35:06 INFO client error method=/memos.api.v1.WorkspaceService/GetWorkspaceProfile error="rpc error: code = Unauthenticated desc = failed to get access token: authorization header format must be Bearer {token}"
2024/10/26 13:35:06 INFO client error method=/memos.api.v1.AuthService/GetAuthStatus error="rpc error: code = Unauthenticated desc = failed to get access token: authorization header format must be Bearer {token}"
2024/10/26 13:35:09 INFO client error method=/memos.api.v1.WorkspaceService/GetWorkspaceProfile error="rpc error: code = Unauthenticated desc = failed to get access token: authorization header format must be Bearer {token}"
2024/10/26 13:35:09 INFO client error method=/memos.api.v1.AuthService/GetAuthStatus error="rpc error: code = Unauthenticated desc = failed to get access token: authorization header format must be Bearer {token}"
2024/10/26 13:35:28 INFO client error method=/memos.api.v1.WorkspaceService/GetWorkspaceProfile error="rpc error: code = Unauthenticated desc = failed to get access token: authorization header format must be Bearer {token}"
2024/10/26 13:35:28 INFO client error method=/memos.api.v1.AuthService/GetAuthStatus error="rpc error: code = Unauthenticated desc = failed to get access token: authorization header format must be Bearer {token}"
2024/10/26 13:35:44 INFO client error method=/memos.api.v1.WorkspaceService/GetWorkspaceProfile error="rpc error: code = Unauthenticated desc = failed to get access token: authorization header format must be Bearer {token}"
2024/10/26 13:35:44 INFO client error method=/memos.api.v1.AuthService/GetAuthStatus error="rpc error: code = Unauthenticated desc = failed to get access token: authorization header format must be Bearer {token}"
2024/10/26 13:36:02 INFO client error method=/memos.api.v1.AuthService/GetAuthStatus error="rpc error: code = Unauthenticated desc = failed to get access token: authorization header format must be Bearer {token}"
2024/10/26 13:36:02 INFO client error method=/memos.api.v1.WorkspaceService/GetWorkspaceProfile error="rpc error: code = Unauthenticated desc = failed to get access token: authorization header format must be Bearer {token}"
version: "3"
services:
  memos:
    image: neosmemo/memos:latest
    networks:
      - traefik-public
      - memos-network
    volumes:
      - ./volumes/memos:/var/opt/memos
    environment:
      - MEMOS_INSTANCE_URL=memos.mydomain.ch
    deploy:
      replicas: 1
      labels:
        - traefik.enable=true
        - traefik.http.services.memos.loadbalancer.server.port=5230
        - traefik.http.routers.memos.rule=Host(`memos.mydomain.com`)
        - traefik.http.routers.memos.entrypoints=websecure
        - traefik.http.routers.memos.tls.certresolver=letsencryptresolver
        - traefik.http.routers.memos.middlewares=sslheader@file
        # The username password pair is generated by:
        # echo $(htpasswd -nb admin pass) | sed -e s/\\$/\\$\\$/g

networks:
  traefik-public:
    external: true
  memos-network:
    external: false

Steps to reproduce

Just run the stack.

version: "3"
services:
  memos:
    image: neosmemo/memos:latest
    networks:
      - traefik-public
      - memos-network
    volumes:
      - ./volumes/memos:/var/opt/memos
    environment:
      - MEMOS_INSTANCE_URL=memos.mydomain.ch
    deploy:
      replicas: 1
      labels:
        - traefik.enable=true
        - traefik.http.services.memos.loadbalancer.server.port=5230
        - traefik.http.routers.memos.rule=Host(`memos.mydomain.com`)
        - traefik.http.routers.memos.entrypoints=websecure
        - traefik.http.routers.memos.tls.certresolver=letsencryptresolver
        - traefik.http.routers.memos.middlewares=sslheader@file
        # The username password pair is generated by:
        # echo $(htpasswd -nb admin pass) | sed -e s/\\$/\\$\\$/g

networks:
  traefik-public:
    external: true
  memos-network:
    external: false

The version of Memos you're using.

0.23.0

Screenshots or additional context

The website remain blank

HT-Moh avatar Oct 26 '24 13:10 HT-Moh

Generated by ChatGPT

The error rpc error: code = Unauthenticated desc = failed to get access token: authorization header format must be Bearer {token} typically indicates that the Memos service could not receive the expected access token format when handling authentication. Here are some common causes and solutions:

1. Traefik Configuration Issues

In the Traefik configuration, it’s possible that the Authorization header is not correctly forwarded to the Memos service. You can try adding the following configuration to ensure the header is retained:

      - traefik.http.middlewares.memos-headers.headers.customRequestHeaders.Authorization=Authorization

2. Check Middlewares Between Traefik and Memos

Ensure that the sslheader@file middleware defined in Traefik is not interfering with the Authorization header. You can check the middleware settings in traefik.yml to confirm that the Authorization header isn’t being removed or overridden.

johnnyjoygh avatar Oct 28 '24 05:10 johnnyjoygh

Thanks the following works - traefik.http.middlewares.memos-headers.headers.customRequestHeaders.Authorization=Authorization

HT-Moh avatar Oct 30 '24 20:10 HT-Moh