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

24.8.0 When logging in for the first time, click Continue after completing the configuration. 400 error #3299

Open
haiboer97 opened this issue Aug 28, 2024 · 17 comments

Comments

@haiboer97
Copy link

Self-Hosted Version

24.8.0

CPU Architecture

x86_64

Docker Version

20.10.10

Docker Compose Version

2.29.2

Steps to Reproduce

When logging in for the first time, click Continue after completing the configuration. 400 error

/api/0/internal/options/?query=is:required 400 (Bad Request)

Expected Result

success login

Actual Result

[WARNING] django.request: Bad Request: /api/0/internal/options/ (status_code=400 request=<WSGIRequest: PUT '/api/0/internal/options/?query=is:required'>)
[WARNING] django.request: Bad Request: /api/0/internal/options/ (status_code=400 request=<WSGIRequest: PUT '/api/0/internal/options/?query=is:required'>)

Event ID

No response

@haiboer97 haiboer97 changed the title When logging in for the first time, click Continue after completing the configuration. 400 error 24.8.0 When logging in for the first time, click Continue after completing the configuration. 400 error Aug 28, 2024
@haiboer97
Copy link
Author

Image

@aldy505
Copy link
Collaborator

aldy505 commented Aug 29, 2024

400 means there is a field that you haven't fill in yet. From the screenshot, I can see that you haven't check one of "Send my contact information along with usage statistics" and "Please keep my usage information anonymous". Can you confirm that you've filled every fields?

@haiboer97
Copy link
Author

I actually tried to check all the options, but the same error message still appeared. However, when I stayed on this page for a while without any operation, I could enter the main interface after refreshing. At this time, I needed to modify ADMIN--》settings--》Usage Statistics to make everything work properly. Otherwise, the error message would still appear when I logged in again next time.

@kovsienko
Copy link

Self-Hosted Version
24.8.0
24.7.1
CPU Architecture
x86_64

Docker Version
20.10.21

Docker Compose Version
2.29.2

Steps to Reproduce
When logging in for the first time, click Continue after completing the configuration. 400 error

/api/0/internal/options/?query=is:required 400 (Bad Request)

Expected Result
success login

Same problem.
It was resolved in the same way. just wait on the open tab for 10-15 minutes. Then I did as recommended by DMIN--》settings--》Usage Statistics

@hubertdeng123
Copy link
Member

Interesting, I'm not able to reproduce this issue on my side..

@jaydrogers
Copy link

jaydrogers commented Sep 6, 2024

I am experiencing this issue too. I am running a brand new configuration of 24.8.0.

I cannot get past this page.

Note

I submitted the form with all the fields selected. I just removed my email for the screenshot.

Image

@aldy505
Copy link
Collaborator

aldy505 commented Sep 10, 2024

I am experiencing this issue too. I am running a brand new configuration of 24.8.0.

I cannot get past this page.

@jaydrogers I'm going to try to repro this during the weekend, but a quick question: How did you set things up? Is it just:

git clone https://github.com/getsentry/self-hosted.git
cd self-hosted
sudo ./install.sh

@jaydrogers
Copy link

Thanks for checking it out. It's basically the steps that I followed other than configuring the sentry configs.

I did put a Traefik container in front of it for automated SSL, but I didn't see any evidence that it was Traefik or CloudFlare causing the issue.

Here is my docker-compose.overrride.yml:

services:
  nginx:
      ports: []
      labels:
       - "traefik.enable=true"
       - "traefik.docker.network=sentry_onpremise_default"
       - "traefik.http.routers.sentry.rule=Host(`myhost.example.com`)"
       - "traefik.http.routers.sentry.entrypoints=websecure"
       - "traefik.http.routers.sentry.tls=true"
       - "traefik.http.routers.sentry.tls.certresolver=letsencryptresolver"
       - "traefik.http.services.sentry.loadbalancer.server.port=80"
       - "traefik.http.services.sentry.loadbalancer.server.scheme=http"

  traefik:
    image: traefik:v3.1
    container_name: traefik
    restart: always
    networks:
        - default
    ports:
      # Listen on port 80, default for HTTP, necessary to redirect to HTTPS
      - target: 80
        published: 80
        mode: host
      # Listen on port 443, default for HTTPS
      - target: 443
        published: 443
        mode: host
    logging:
      driver: journald
      options:
        tag: traefik
    volumes:
      # Add Docker as a mounted volume, so that Traefik can read the labels of other services
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./traefik.yml:/traefik.yml:ro
      - traefik-certificates:/certificates/


networks:
  default:

volumes:
  traefik-certificates:

My traefik config was pretty basic other than some CloudFlare configs to restore original IP addresses:

# Cloudflare TrustedIPs
x-trustedIps: &trustedIPs
  - "173.245.48.0/20"
  - "103.21.244.0/22"
  - "103.22.200.0/22"
  - "103.31.4.0/22"
  - "141.101.64.0/18"
  - "108.162.192.0/18"
  - "190.93.240.0/20"
  - "188.114.96.0/20"
  - "197.234.240.0/22"
  - "198.41.128.0/17"
  - "162.158.0.0/15"
  - "104.16.0.0/13"
  - "104.24.0.0/14"
  - "172.64.0.0/13"
  - "131.0.72.0/22"
  - "2400:cb00::/32"
  - "2606:4700::/32"
  - "2803:f800::/32"
  - "2405:b500::/32"
  - "2405:8100::/32"
  - "2a06:98c0::/29"
  - "2c0f:f248::/32"

serversTransport:
  insecureSkipVerify: true

providers:
  docker:
    exposedByDefault: false
    network: sentry_sentry-self-hosted_default

entryPoints:
  web:
    address: ":80"
    http:
      redirections:
        entrypoint:
          to: websecure
          scheme: https
    forwardedHeaders:
      trustedIPs: *trustedIPs
    proxyProtocol:
      trustedIPs: *trustedIPs

  websecure:
    address: ":443"
    forwardedHeaders:
      trustedIPs: *trustedIPs
    proxyProtocol:
      trustedIPs: *trustedIPs

accessLog: {}
log:
  level: ERROR

api:
  dashboard: true
  insecure: true

certificatesResolvers:
  letsencryptresolver:
    acme:
      email: "[email protected]"
      storage: "/certificates/acme.json"
      httpChallenge:
        entryPoint: web

Just a heads up

I did head a different direction than setting up a self-hosted Sentry, but I wanted to share the details of my experience in case it helped others 👍

@wooch82
Copy link

wooch82 commented Sep 18, 2024

Hi everyone, I had the same problem for the clean installation and k8s. Found this error in the console:
Image
So, I commented a mail section in the helm chart, redeployed the chart, and passed this screen without any problems.

@djooberlee
Copy link

djooberlee commented Sep 18, 2024

I have the same problem
with versions 24.7.1, 24.8.0, 24.9.0

UPD:
Really!!!
after I commented the mail.use-ssl: false line in the sentry/config.yml file - the problem disappeared

@aldy505
Copy link
Collaborator

aldy505 commented Sep 21, 2024

UPD: Really!!! after I commented the mail.use-ssl: false line in the sentry/config.yml file - the problem disappeared

@djooberlee Just to confirm, does the SMTP server you're using does not use any TLS protocol (no STARTTLS or anything, just plain text)? If that works, maybe we can update the config/documentation about this.

@djooberlee
Copy link

@aldy505
We use TLS.
Previously, SSL was explicitly listed as disabled, but now I just commented out the line

this is how it looks now

mail.backend: 'smtp'
mail.host: 'smtp.example.com'
mail.port: 587
mail.username: '[email protected]'
mail.password: 'PASSWORD'
mail.use-tls: True
#mail.use-ssl: false
mail.from: '[email protected]'
mail.enable-replies: False
mail.reply-hostname: ''

@aldy505
Copy link
Collaborator

aldy505 commented Sep 21, 2024

@aldy505 We use TLS. Previously, SSL was explicitly listed as disabled, but now I just commented out the line

this is how it looks now

mail.backend: 'smtp'
mail.host: 'smtp.example.com'
mail.port: 587
mail.username: '[email protected]'
mail.password: 'PASSWORD'
mail.use-tls: True
#mail.use-ssl: false
mail.from: '[email protected]'
mail.enable-replies: False
mail.reply-hostname: ''

Ah I see, I suppose mail.use-tls and mail.use-ssl is a mutually exclusive configuration? But that's a really good discovery.

@aldy505
Copy link
Collaborator

aldy505 commented Sep 21, 2024

It turned out, it is a mutually exclusive configuration:

Image

See Django's docs: https://docs.djangoproject.com/en/5.1/ref/settings/#std-setting-EMAIL_USE_TLS

@djooberlee
Copy link

It is clear that I cannot set both parameters to TRUE:

mail.use-tls: true
mail.use-ssl: true

But I never did!!!

And it is not clear to me from the documentation that it is not possible to explicitly set:

mail.use-tls: true
mail.use-ssl: false

or

mail.use-tls: false
mail.use-ssl: true

@aldy505
Copy link
Collaborator

aldy505 commented Sep 21, 2024

Yeah we need to document this better.

@vld1234
Copy link

vld1234 commented Oct 9, 2024

I am experiencing this issue too. I am running a brand new configuration of 24.8.0.

I cannot get past this page.

Note

I submitted the form with all the fields selected. I just removed my email for the screenshot.

Image

Have the same issue (App 24.7.1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Waiting for: Product Owner
Status: No status
Development

No branches or pull requests

8 participants