vue应用集成 sentry上传sourcemap不生效, 报错 FileNotFoundError

  1. vue集成sentry后发现无法上传 sourcemap到sentry, 查看 sentry-worker日志发现报错找不到文件
Traceback (most recent call last):                                                                                             │
│   File "/usr/local/lib/python3.6/site-packages/sentry/tasks/assemble.py", line 194, in assemble_artifacts                      │
│     file_type="release.bundle",                                                                                                │
│   File "/usr/local/lib/python3.6/site-packages/sentry/tasks/assemble.py", line 355, in assemble_file                           │
│     temp_file = file.assemble_from_file_blob_ids(file_blob_ids, checksum)                                                      │
│   File "/usr/local/lib/python3.6/site-packages/sentry/models/file.py", line 423, in assemble_from_file_blob_ids                │
│     for chunk in blob.getfile().chunks():                                                                                      │
│   File "/usr/local/lib/python3.6/site-packages/sentry/models/file.py", line 296, in getfile                                    │
│     return storage.open(self.path)                                                                                             │
│   File "/usr/local/lib/python3.6/site-packages/django/core/files/storage.py", line 38, in open                                 │
│     return self._open(name, mode)                                                                                              │
│   File "/usr/local/lib/python3.6/site-packages/django/core/files/storage.py", line 300, in _open                               │
│     return File(open(self.path(name), mode))                                                                                   │
│ FileNotFoundError: [Errno 2] No such file or directory: '/var/lib/sentry/files/b8/5040/1f6bef42cbb0a9a4ef1e2ee1e1'             │
│ 09:27:28 [ERROR] sentry.tasks.assemble: failed to assemble release bundle                                                      │
│ 09:27:42 [WARNING] sentry.tasks.release_registry: Release registry URL is not specified, skipping the task.

进sentry-worker容器发现确实没有, 然后进 sentry-web 容器, 发现有这个文件, 这就很奇怪了。

查看yaml, sentry-worker的 sentry-data是 emptyDir, 但是 sentry-web却是pvc卷, 两者对不上。 最后在values.yaml发现 persistentWorkers 配置为 false了, 也就是sentry默认不启用存储 sourcemap的功能, 打开重新部署就好了

	## Whether to mount the persistent volume to the Sentry worker and
      ## cron deployments. This setting needs to be enabled for some advanced
      ## Sentry features, such as private source maps. If you disable this
      ## setting, the Sentry workers will not have access to artifacts you upload
      ## through the web deployment.
      ## Please note that you may need to change your accessMode to ReadWriteMany
      ## if you plan on having the web, worker and cron deployments run on
      ## different nodes.
      persistentWorkers: false

你可能感兴趣的:(sentry,vue.js,sentry,前端)