Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot delete sessionId in DB when recreate casdoor #2928

Closed
ladung opened this issue May 6, 2024 · 12 comments · Fixed by #2932
Closed

Cannot delete sessionId in DB when recreate casdoor #2928

ladung opened this issue May 6, 2024 · 12 comments · Fixed by #2932
Assignees
Labels
bug Something isn't working released

Comments

@ladung
Copy link

ladung commented May 6, 2024

image

@casbin-bot
Copy link
Contributor

@casbin-bot casbin-bot added the question Further information is requested label May 6, 2024
@hsluoyz
Copy link
Member

hsluoyz commented May 6, 2024

@ladung what did you do to see this? Reproduce steps?

@ladung
Copy link
Author

ladung commented May 6, 2024

@ladung what did you do to see this? Reproduce steps?
@hsluoyz

  1. I start casdoor via docker-compose by command: docker-compose up -d. Login to casdoor in web, show session on tab session
  2. I remove casdoor by run docker-compose down
  3. recreate casdoor by command : docker-compose up -d

My compose file:

version: "3"
services:
  casdoor:
    restart: always
    image: $CASDOOR_IMAGE_TAG
    entrypoint: /bin/sh -c './server --createDatabase=true'
    container_name: casdoor
    environment:
      RUNNING_IN_DOCKER: "true"
      DOMAIN: ${DOMAIN}
    ports:
     - "8080:8080"
    volumes:
      - ./app.conf:/conf/app.conf
      - ./init_data.json:/init_data.json
    networks:
      - backend 
    depends_on:
      postgres:
        condition: service_healthy

  redis:
    image: redis:7.2-alpine
    restart: always
    command: redis-server --maxmemory-policy allkeys-lru --maxmemory 200mb
    networks:
      backend:

  postgres:
    image: ${POSTGRES_IMAGE_TAG}
    volumes:
      - ./data/idp/idp-postgres:/var/lib/postgresql/data
      - ./bin/pg_multiple_databases:/docker-entrypoint-initdb.d
    environment:
      #POSTGRES_DB: ${POSTGRES_DB}
      POSTGRES_MULTIPLE_DATABASES: ${POSTGRES_DB}
      POSTGRES_USER: ${POSTGRES_USER}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
    networks:
      - backend
    healthcheck:
      test: [ "CMD", "pg_isready", "-q", "-d", "${POSTGRES_DB}", "-U", "${POSTGRES_USER}" ]
      interval: 10s
      timeout: 5s
      retries: 3
      start_period: 60s
    restart: always
    ports:
      - "5433:5432"

@hsluoyz
Copy link
Member

hsluoyz commented May 6, 2024

@ladung it seems like a Docker container permission issue. Not a Casdoor issue

@ladung
Copy link
Author

ladung commented May 6, 2024

@ladung it seems like a Docker container permission issue. Not a Casdoor issue

@hsluoyz
I use casdoor version 1.610.0

I double check it when recreate. I saw sessionId was not delete in DB tables. When create user from init_data.json, casdoor require delete sessionid as follow:
https://github.com/casdoor/casdoor/blob/master/object/user.go#L922

If you restart through cmd docker-compose restart, you still have same error!

@ladung
Copy link
Author

ladung commented May 6, 2024

@hsluoyz
And when I delete sessionId in database table session, it's will be work fine!
image

@ladung
Copy link
Author

ladung commented May 6, 2024

@ladung
Copy link
Author

ladung commented May 6, 2024

@hsluoyz Please see issue soon!

@ladung
Copy link
Author

ladung commented May 7, 2024

hi @hsluoyz
Have you seen that?

@dacongda
Copy link
Contributor

dacongda commented May 7, 2024

sorry about that, we will solve this as soon as possible

@dacongda
Copy link
Contributor

dacongda commented May 7, 2024

hi @hsluoyz Have you seen that?

btw, if you enable init data with init_data.json , it will execute when you restart / recreate the casdoor, plz make sure you disable it when you don't need it

@hsluoyz hsluoyz added bug Something isn't working and removed question Further information is requested labels May 7, 2024
@casbin-bot
Copy link
Contributor

🎉 This issue has been resolved in version 1.611.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants