Skip to content

Turbopack instrumentation fails with permission denied error on CI #16121

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

Open
3 tasks done
wladpaiva opened this issue Apr 23, 2025 · 4 comments
Open
3 tasks done

Turbopack instrumentation fails with permission denied error on CI #16121

wladpaiva opened this issue Apr 23, 2025 · 4 comments

Comments

@wladpaiva
Copy link

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/nextjs

SDK Version

9.14.0

Framework Version

Next 15.3.0

Link to Sentry event

No response

Reproduction Example/SDK Setup

https://github.com/wladpaiva/sentry-gh-error

Steps to Reproduce

  1. add a file to the root of the project that sentry wont have permissions
  2. run nextjs on CI

Expected Result

No error at all

Actual Result

Getting this error of permissions denied when running a nextjs with playwright on CI ever since I updated sentry package from 9.6.0 to 9.13.0. Tried the 9.14 but same issue.

Run npx playwright test
  npx playwright test
  shell: /usr/bin/bash -e {0}
  
[WebServer] [Error [TurbopackInternalError]: [project]/node_modules/@sentry/nextjs/build/cjs/config/withSentryConfig.js [instrumentation] (ecmascript)
[WebServer] 
[WebServer] Caused by:
[WebServer] - reading dir /home/runner/work/sentry-gh-error/sentry-gh-error/docker-data/postgres
[WebServer] - Permission denied (os error 13)
[WebServer] 
[WebServer] Debug info:
[WebServer] - Execution of TaskId { id: [2](https://github.com/wladpaiva/sentry-gh-error/actions/runs/14629634922/job/41049218132#step:8:2)147483652 } transient failed
[WebServer] - Execution of get_written_endpoint_with_issues_operation failed
[WebServer] - Execution of endpoint_write_to_disk failed
[WebServer] - Execution of <InstrumentationEndpoint as Endpoint>::output failed
[WebServer] - Execution of InstrumentationEndpoint::output_assets failed
[WebServer] - Execution of InstrumentationEndpoint::node_chunk failed
[WebServer] - Execution of ModuleGraph::from_entry_module failed
[WebServer] - Execution of SingleModuleGraph::new_with_entries failed
[WebServer] - [project]/node_modules/@sentry/nextjs/build/cjs/config/withSentryConfig.js [instrumentation] (ecmascript)
[WebServer] - Execution of primary_chunkable_referenced_modules failed
[WebServer] - Execution of resolve_reference_from_dir failed
[WebServer] - Execution of read_matches failed
[WebServer] - Execution of read_matches failed
[WebServer] - Execution of read_matches failed
[WebServer] - Execution of read_matches failed
[WebServer] - Execution of <DiskFileSystem as FileSystem>::raw_read_dir failed
[WebServer] - reading dir /home/runner/work/sentry-gh-error/sentry-gh-error/docker-data/postgres
[WebServer] - Permission denied (os error 1[3](https://github.com/wladpaiva/sentry-gh-error/actions/runs/14629634922/job/41049218132#step:8:3))]
Error: Process from config.webServer exited early.
Error: Process completed with exit code 1.
@lforst
Copy link
Member

lforst commented Apr 24, 2025

Hi, I don't think the SDK is reading random files. The SDK is trying to read instrumentation files and .git related files but I don't think anything else. I fear this might be a turbopack problem and not a Sentry problem. Would you mind raising it upstream in the Next.js repo?

Also, what kind of file without read perms are you creating?

@wladpaiva
Copy link
Author

wladpaiva commented Apr 24, 2025

Those are postgres files that are created during the CI setup. I suppose I could raise it to the nextjs team but it's likely they will reject it since nextjs works fine without the sentry installed.

I created this PR on the reproduction repo only removing sentry from the stack and you can see the gh action works as expected
wladpaiva/sentry-gh-error#1

Another point is that it used to work fine with 9.6.0

Added stdout and here is details of the error

Run npx playwright test
[WebServer] 
[WebServer] > sentry-gh-error@0.1.0 dev
[WebServer] > next dev --turbopack
[WebServer] 
[WebServer]    ▲ Next.js 15.3.1 (Turbopack)
[WebServer]    - Local:        http://localhost:3000
[WebServer]    - Network:      http://10.1.0.69:3000
[WebServer]    - Environments: .env
[WebServer]    - Experiments (use with caution):
[WebServer]      · clientTraceMetadata
[WebServer] 
[WebServer]  ✓ Starting...
[WebServer] Attention: Next.js now collects completely anonymous telemetry regarding usage.
[WebServer] This information is used to shape Next.js' roadmap and prioritize features.
[WebServer] You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
[WebServer] https://nextjs.org/telemetry
[WebServer] 
[WebServer]  ○ Compiling instrumentation Node.js ...
[WebServer] [Error [TurbopackInternalError]: [project]/node_modules/@sentry/nextjs/build/cjs/config/withSentryConfig.js [instrumentation] (ecmascript)
[WebServer] 
[WebServer] Caused by:
[WebServer] - reading dir /home/runner/work/sentry-gh-error/sentry-gh-error/docker-data/postgres
[WebServer] - Permission denied (os error 13)
[WebServer] 
[WebServer] Debug info:
[WebServer] - Execution of TaskId { id: 21[4](https://github.com/wladpaiva/sentry-gh-error/actions/runs/14641569003/job/41085024392#step:8:5)7483652 } transient failed
[WebServer] - Execution of get_written_endpoint_with_issues_operation failed
[WebServer] - Execution of endpoint_write_to_disk failed
[WebServer] - Execution of <InstrumentationEndpoint as Endpoint>::output failed
[WebServer] - Execution of InstrumentationEndpoint::output_assets failed
[WebServer] - Execution of InstrumentationEndpoint::node_chunk failed
[WebServer] - Execution of ModuleGraph::from_entry_module failed
[WebServer] - Execution of SingleModuleGraph::new_with_entries failed
[WebServer] - [project]/node_modules/@sentry/nextjs/build/cjs/config/withSentryConfig.js [instrumentation] (ecmascript)
[WebServer] - Execution of primary_chunkable_referenced_modules failed
[WebServer] - Execution of resolve_reference_from_dir failed
[WebServer] - Execution of read_matches failed
[WebServer] - Execution of read_matches failed
[WebServer] - Execution of read_matches failed
[WebServer] - Execution of read_matches failed
[WebServer] - Execution of <DiskFileSystem as FileSystem>::raw_read_dir failed
[WebServer] - reading dir /home/runner/work/sentry-gh-error/sentry-gh-error/docker-data/postgres
[WebServer] - Permission denied (os error 13)]
[WebServer] 2[5](https://github.com/wladpaiva/sentry-gh-error/actions/runs/14641569003/job/41085024392#step:8:6)h[WebServer]

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Apr 24, 2025
@lforst
Copy link
Member

lforst commented Apr 24, 2025

I think it's still worth asking. We are not doing anything too unorthodox and it is very well a potential Next.js issue if it fails to compile an ordinary package! I'll ping them.

@wladpaiva
Copy link
Author

Done

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

No branches or pull requests

3 participants