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

[9.1.0 On-Premise] AssertionError: cannot be changed at runtime because it is configured on disk #12722

Closed
1 of 3 tasks
zoltanlaczko opened this issue Apr 10, 2019 · 29 comments
Closed
1 of 3 tasks

Comments

@zoltanlaczko
Copy link

Important Details

How are you running Sentry?

  • On-Premise docker [Version 9.1.0]
  • Saas (sentry.io)
  • Other [briefly describe your environment]

Description

Fresh docker install gives internal server error on welcome page. cannot bypass.

Steps to Reproduce

  1. Follow the how-to on https://hub.docker.com/_/sentry/ and start sentry first time
  2. Create a super-user during upgrade process
  3. Login with the super-user
  4. On "Welcome to Sentry" page fill the "Root URL" and "Admin Email" and press Continue
  5. "Unable to save your changes. Please ensure all fields are valid and try again."

Good items to include here include:

in chrome developer tools the request triggered an Internal Server Error.

in docker logs:
AssertionError: u'mail.port' cannot be changed at runtime because it is configured on disk, 20:40:05 [INFO] sentry.superuser: superuser.request (user_id=1 url=u'http://127.0.0.1:9000/api/0/internal/options/?query=is:required' ip_address=u'xxx.xxx.xxx.xxx' method=u'PUT'), File "/usr/local/lib/python2.7/site-packages/sentry/options/manager.py", line 90, in set, ), '%r cannot be changed at runtime because it is configured on disk' % key, options.set(k, v), File "/usr/local/lib/python2.7/site-packages/sentry/api/endpoints/system_options.py", line 79, in put, response = handler(request, *args, **kwargs), File "/usr/local/lib/python2.7/site-packages/sentry/api/base.py", line 190, in dispatch, response = super(Endpoint, self).handle_exception(exc), File "/usr/local/lib/python2.7/site-packages/sentry/api/base.py", line 90, in handle_exception, Traceback (most recent call last):
default config.yml file (only comments), only the secret_key is set in docker command.

What you expected to happen

Save the configuration without any errors

Possible Solution

@yufuluo
Copy link

yufuluo commented Apr 10, 2019

I tried to deploy 9.1.0 on Kubernetes with helm and got the exact same error, try with default sentry.conf.py and config.yml but no luck.

Here's what I got from api/0/internal/options/?query=is:required:

{"mail.use-tls": {"field": {"disabledReason": null, "default": false, "required": true, "disabled": false, "allowEmpty": true, "isSet": true}, "value": false}, "mail.username": {"field": {"disabledReason": null, "default": "", "required": true, "disabled": false, "allowEmpty": true, "isSet": true}, "value": ""}, "mail.port": {"field": {"disabledReason": "diskPriority", "default": 25, "required": true, "disabled": true, "allowEmpty": false, "isSet": true}, "value": 25}, "system.admin-email": {"field": {"disabledReason": null, "default": "", "required": true, "disabled": false, "allowEmpty": false, "isSet": false}, "value": ""}, "mail.password": {"field": {"disabledReason": null, "default": "", "required": true, "disabled": false, "allowEmpty": true, "isSet": true}, "value": ""}, "mail.from": {"field": {"disabledReason": "diskPriority", "default": "root@localhost", "required": true, "disabled": true, "allowEmpty": false, "isSet": true}, "value": "noreply@company.com"}, "system.url-prefix": {"field": {"disabledReason": null, "default": "", "required": true, "disabled": false, "allowEmpty": false, "isSet": false}, "value": ""}, "auth.allow-registration": {"field": {"disabledReason": null, "default": false, "required": true, "disabled": false, "allowEmpty": true, "isSet": false}, "value": false}, "beacon.anonymous": {"field": {"disabledReason": null, "default": false, "required": true, "disabled": false, "allowEmpty": true, "isSet": false}, "value": false}, "mail.host": {"field": {"disabledReason": "diskPriority", "default": "localhost", "required": true, "disabled": true, "allowEmpty": false, "isSet": true}, "value": "mailhost.company.company.com"}}

@dotconnor
Copy link

dotconnor commented Apr 11, 2019

Currently in the same boat.

Tried manually configuring each available option in config.yml:

auth.allow-registration: false
beacon.anonymous: true
mail.from: ""
mail.host: ""
mail.password: ""
mail.port: 465
mail.use-tls: true
mail.username: ""
system.admin-email: ""
system.url-prefix: ""

However, the onboarding page still shows up

EDIT:
After waiting an hour and then reloading the page, the config settings seemed to have kicked in, and now I'm sent directly to the issues stream. Maybe a cache issue there?

@zoltanlaczko
Copy link
Author

confirmed: save the same in config.yml, restart the docker containers and you are in.

@ne1000
Copy link

ne1000 commented Apr 11, 2019

@zoltanlaczko @dotconnor I also met the same issues, save the same in config.yml then docker-compose restart , but I still met the issues

@zoltanlaczko
Copy link
Author

@ne1000 : docker stop&rm&run. you have to delete the container before

@dotconnor
Copy link

After setting your config in config.yml, if you still got the Setup Sentry page, you need to set the version in the config:

# TODO(dcramer): this has nothing to do with configuring options and
# should not be set here
options.set('sentry:version-configured', sentry.get_version())

If you're using docker, then run the following command on the web container:

docker exec CONTAINER sentry config set sentry:version-configured '9.1.0'

@ne1000
Copy link

ne1000 commented Apr 11, 2019

@dotconnor yes, it's ok, i'm logined , but how to set up mail delivery ?

@ne1000
Copy link

ne1000 commented Apr 11, 2019

@zoltanlaczko thanks, but it's not ok for me, need to run command as below :
docker exec CONTAINER sentry config set sentry:version-configured '9.1.0'
then it's ok...

@DaveIW2034
Copy link

```shell
docker exec CONTAINER sentry config set sentry:version-configured '9.1.0'

thanks @ @dotconnor :))

@zachary95
Copy link

If you're modifying your config.yml just like suggested above but nothing happens and you're about to give up on life, you need to rebuild the image.

To sum up :

  • Do the edits on config.yml
  • Run make build
  • Execute docker exec <your_container_name || 'sentry-web-01'> sentry config set sentry:version-configured '9.1.0'
  • Then login and tada! 🎉

@ne1000
Copy link

ne1000 commented Apr 15, 2019

@dotconnor Mail still can't be sent. I use SSL protocol instead of tls. Is that the reason?

@itpimp
Copy link

itpimp commented Apr 15, 2019

Tried all, can logon, but not past the setup page.

@markotitel
Copy link

@itpimp Here are the steps that are working.
https://gist.github.com/markotitel/2cbb40ed5a745f0cf3f8ce12395efc11

@Trick93
Copy link

Trick93 commented Apr 18, 2019

@dotconnor
@ne1000
i try run
docker exec onpremise_web_1 sentry config set sentry:version-configured '9.1.0'
i got

04:05:08 [WARNING] sentry.utils.geo: GeoIP module not available.
04:05:08 [WARNING] sentry.utils.geo: No GeoIP MMDB database configured
04:05:12 [INFO] sentry.plugins.github: apps-not-configured
Unhandled exception in thread started by <bound method Thread.__bootstrap of <Thread(Thread-1, stopped daemon 140474876421888)>>
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/threading.py", line 774, in __bootstrap
    self.__bootstrap_inner()
  File "/usr/local/lib/python2.7/threading.py", line 814, in __bootstrap_inner
    (self.name, _format_exc()))
  File "/usr/local/lib/python2.7/traceback.py", line 241, in format_exc
    etype, value, tb = sys.exc_info()
AttributeError: 'NoneType' object has no attribute 'exc_info'

and it also in setup page.


update:

i wait a few hours,and it skip the setup pages

@Zegorax
Copy link

Zegorax commented Apr 18, 2019 via email

@dcramer
Copy link
Member

dcramer commented Apr 19, 2019

This is resolved in sentry master and will be fixed in 9.1.1 which we're hoping to get out later today.

See also #12778 and getsentry/self-hosted#167

@dcramer dcramer closed this as completed Apr 19, 2019
@basitsattar
Copy link

I am using onpremise repo and still getting the same error.

@dcramer
Copy link
Member

dcramer commented Apr 22, 2019

Are you using 9.1.1?

@ahalf-yuan
Copy link

I change to 9.0.0, and it's ok.

@DaveIW2034
Copy link

I am using onpremise repo and still getting the same error.
change to 9.0.0

@uhlhosting
Copy link

Same issue here

@Fogapod
Copy link

Fogapod commented Sep 16, 2019

I get same error saving settings on admin panel. I'm running On-Premise docker 9.1.2.
Error: AssertionError u'system.url-prefix' cannot be changed at runtime because it is configured on disk

@salty-horse
Copy link
Contributor

I also have the system.url-prefix error with 9.1.2. I changed it in config.yml, restarted sentry, and when I try to change an unrelated setting in the /manage/settings/ screen, it returns the exception. (The url-prefix change did apply itself correctly, and is used in emails sentry sends.)

@BYK
Copy link
Member

BYK commented Feb 3, 2020

@salty-horse if you can replicate this in Sentry 10, can you file a new issue please?

@salty-horse
Copy link
Contributor

The issue was that I tried setting system.url-prefix in config.yml to a value different that what was in the database's system.url-prefix option. When I opened the settings screen, the config.yml value was populated in the "Root URL" field, and that field was disabled. Pressing "Save changes" apparently tries to save that new value.

Maybe I wasn't supposed to do that, but nothing in the documentation, the live error message ("error saving settings" or somesuch), or the sentry exception hinted at what was wrong.

@BYK
Copy link
Member

BYK commented Feb 3, 2020

@salty-horse I think that behavior is definitely a bug as a disabled field should not affect saving other fields. I'm just curious about whether this still exists in v10 or not, that's why I asked.

@salty-horse
Copy link
Contributor

Sorry, I'm not in a position to test Sentry 10 right now :( Hopefully I described the problem in enough detail in case others encounter the same issue, and don't know how to solve it, and for any willing testers to check if it still occurs.

@NaveenGovindraj
Copy link

Hello All,

I have just installed Sentry On-premise 10 (sentry, version 10.1.0.dev0) and I also face the same error that @Fogapod and @salty-horse seem to be facing.

My Scenario:
I wrongly set the system.url-prefix (https://sentry.organization.com) while configuring Sentry on our on-premise server, and I was looking forward to changing it. When I tried to execute the below command(example):
sudo docker-compose run --rm web sentry config set system.url-prefix http://sentry.neworganization.com

I get a similar error message stating:
AssertionError: u'system.url-prefix' cannot be changed at runtime because it is configured on disk.

If my scenario is not relevant to this topic in discussion, kindly advise me on how to resolve this issue.
Please let me know if any further information is needed from my end
Thanks in advance.

Best Regards
Naveen

@BYK
Copy link
Member

BYK commented Mar 17, 2020

@NaveenGovindraj it is not related. You need to set this value in your config files and rebuild the sentry container image via docker-compose build

@github-actions github-actions bot locked and limited conversation to collaborators Dec 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests