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

Service migration issue #3032

Open
swenker opened this issue May 9, 2024 · 6 comments
Open

Service migration issue #3032

swenker opened this issue May 9, 2024 · 6 comments

Comments

@swenker
Copy link

swenker commented May 9, 2024

Self-Hosted Version

23.7.2

CPU Architecture

x86_64

Docker Version

24.0.9

Docker Compose Version

2.27.0

Steps to Reproduce

1.install sentry on Server1 and make sure it works well;
2.stop docker service on Server1
3. copy the full docker data folder(/var/lib/docker) from Server1 to Server2.
4. start docker service on Server2
5. on Server2 docker-compose up -d

Expected Result

the service on Server2 works well .

Actual Result

I can login and view the projects and issues under projects. but the request http://server2:9000/organizations/myorg-sentry/issues/ doesn't work.
I check browser console, there's request like this http://server1:9000/api/1/envelope/?sentry_key=e86296ce46df9af06d9e99d56ff941c7&sentry_version=7&sentry_client=sentry.javascript.react%2F7.60.1'

and this leads to" Content Security Policy" issue in browser.

Now it seems all the others features works well except this one.

Do you guys know how I can fix this issue?

Event ID

No response

@azaslavsky
Copy link
Contributor

Did you run ./install.sh on server 2? It configures your server in ways that I don't think are entirely captured by docker exports (ex: the config file lives in the self-hosted repo, not inside docker).

@swenker
Copy link
Author

swenker commented May 11, 2024

Did you run ./install.sh on server 2? It configures your server in ways that I don't think are entirely captured by docker exports (ex: the config file lives in the self-hosted repo, not inside docker).

mm, I didn't run install.sh because Server2 couldn't connect to internet. That's why I copied all the docker data folder from Server1 to Server2.
As to the result , it seems the Server1 address is saved ? I searched both docker data folder and sentry folder(containing install.sh ) nothing found. Maybe it's saved in some database table of sentry?

@hubertdeng123
Copy link
Member

We would highly recommend you to run install.sh on Server2 to make sure the config changes are picked up. I would suspect the address is saved somewhere in postgres but unsure exactly where.

@swenker
Copy link
Author

swenker commented May 18, 2024

I tried execute install.sh on Server2 , it shows internet connection is needed. So it failed .

I also tried to clean the issues by the following steps :

  1. login to sentry worker container and execute : sentry cleanup --days 3000
  2. login to postgres container and do VACUUM FULL;
    what I expected is that all the issues should be removed. But there are still some items left.

do you have a more detailed guide on how to clean the data in sentry except the admin user?

@azaslavsky
Copy link
Contributor

An instance can't really be created without running install.sh. More generally, we didn't really design the install and setup process to work offline, because a self-hosted server requires an internet connection anyway.

@swenker
Copy link
Author

swenker commented May 24, 2024

finally I found the config item in /manage/status/environment/ ,

SENTRY_URL_PREFIX
'http://ServerA:9000'

It can be changed within "Settings" -> "Root URL"

I also found the item is stored in table sentry_option with key name system.url-prefix.

Let me make a simple summary :

  1. I install sentry on a server which can connect to the internet and docker-compose up the service
  2. I docker-compose down the service and stop docker service.
  3. tar docker data folder.
  4. scp docker data to the target server2 which has no access to internet.
  5. link docker data folder on server2 to the data from server1 and start docker service
  6. docker-compose up the service on server2
  7. login to postgres and update the value of key system.url-prefix to from server1:9000 to server2:9000
  8. docker-compose down then up.
  9. done

Thanks for your support.

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

3 participants