Skip to content
3 changes: 2 additions & 1 deletion devservices/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ x-sentry-service-config:
taskbroker: [snuba, postgres, relay, spotlight, taskbroker]
taskworker:
[snuba, postgres, relay, taskbroker, spotlight, taskworker, taskworker-scheduler]
backend-ci: [snuba, postgres, redis, bigtable, redis-cluster, symbolicator]
backend-ci:
[snuba, postgres, redis, bigtable, redis-cluster, symbolicator, objectstore]
symbolicator: [postgres, snuba, symbolicator, spotlight]
memcached: [postgres, snuba, memcached, spotlight]
tracing:
Expand Down
15 changes: 15 additions & 0 deletions src/sentry/lang/native/symbolicator.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
from sentry.objectstore import get_attachments_session
from sentry.options.rollout import in_random_rollout
from sentry.utils import metrics
from sentry.utils.env import in_test_environment

MAX_ATTEMPTS = 3

Expand Down Expand Up @@ -186,6 +187,7 @@ def process_minidump(
if minidump.stored_id:
session = get_attachments_session(self.project.organization_id, self.project.id)
storage_url = session.object_url(minidump.stored_id)
storage_url = maybe_rewrite_objectstore_url(storage_url)
json: dict[str, Any] = {
"platform": platform,
"sources": sources,
Expand Down Expand Up @@ -231,6 +233,7 @@ def process_applecrashreport(self, platform: str, report: CachedAttachment):
if report.stored_id:
session = get_attachments_session(self.project.organization_id, self.project.id)
storage_url = session.object_url(report.stored_id)
storage_url = maybe_rewrite_objectstore_url(storage_url)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of rewriting the the URL here, can we set the objectstore.config option to point to objectstore in tests?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you did that you would run into the opposite problem, i.e. sentry wouldn't be able to reach http://objectstore:8888, because sentry is not running in docker.

json: dict[str, Any] = {
"platform": platform,
"sources": sources,
Expand Down Expand Up @@ -488,3 +491,15 @@ def query_task(self, task_id):

def reset_worker_id(self):
self.worker_id = uuid.uuid4().hex


def maybe_rewrite_objectstore_url(url: str) -> str:
"""
This is needed during development/testing to make Symbolicator reach Objectstore.
This is because Sentry can reach Objectstore on 127.0.0.1 but Symbolicator cannot, as it's running in its own container.

Note: if you are using a local (not containerized) instance of Symbolicator, you need to disable this logic.
"""
if settings.IS_DEV or in_test_environment():
url = url.replace("127.0.0.1", "objectstore")
return url
2 changes: 1 addition & 1 deletion src/sentry/testutils/skips.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def _requires_objectstore() -> None:
# TODO: ability to ask devservices what port a service is on
if not _service_available("127.0.0.1", 8888):
service_message = "requires 'objectstore' server running\n\t💡 Hint: run `devservices up --mode=objectstore`"
pytest.skip(service_message)
pytest.fail(service_message)


requires_snuba = pytest.mark.usefixtures("_requires_snuba")
Expand Down
Loading