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

ERR_DLOPEN_FAILED for Sodium native #260

Open
2 tasks done
Pfeifenjoy opened this issue Feb 4, 2025 · 3 comments
Open
2 tasks done

ERR_DLOPEN_FAILED for Sodium native #260

Pfeifenjoy opened this issue Feb 4, 2025 · 3 comments

Comments

@Pfeifenjoy
Copy link

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Fastify version

5.2.1

Plugin version

8.1.0

Node.js version

22.13.1

Operating system

Linux

Operating system version (i.e. 20.04, 11.3, 10)

arch

Description

While importing the @fastify/secure-session plugin I get the following error:

Welcome to Node.js v22.13.1.                                                                                                                                                                  
Type ".help" for more information.                                                                                                                                                            
> require("@fastify/secure-session")                                                                                                                                                          
Uncaught:                                                                                                                                                                                     
Error: /home/<path to project>/node_modules/sodium-native/prebuilds/linux-x64/sodium-native.node: cannot enable executable stack as shared object requires: Invalid argument  
    at Object..node (node:internal/modules/cjs/loader:1725:18)                                                                                                                                
    at Module.load (node:internal/modules/cjs/loader:1313:32)                                                                                                                                 
    at Function._load (node:internal/modules/cjs/loader:1123:12)                                                                                                                              
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)                                                                                                                             
    at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)                                                                                                                               
    at Module.require (node:internal/modules/cjs/loader:1335:12)                                                                                                                              
    at require (node:internal/modules/helpers:136:16)                                                                                                                                         
    at load (/home/<path to project>/node_modules/node-gyp-build/node-gyp-build.js:22:10)                                                                                     
    at Object.<anonymous> (/home/<path to project>/node_modules/sodium-native/index.js:1:43) {                                                                                
  code: 'ERR_DLOPEN_FAILED'                                                                                                                                                                   
}

I guess this is a sodium-native bug but this package is required by @fastify/secure-session.

Link to code that reproduces the bug


Expected Behavior

No response

@mcollina
Copy link
Member

mcollina commented Feb 5, 2025

Migh be related to holepunchto/sodium-native#202.

@mcollina
Copy link
Member

mcollina commented Feb 5, 2025

Can you verify if #247 fixes it?

@Pfeifenjoy
Copy link
Author

Pfeifenjoy commented Feb 6, 2025

Thanks the PR solves it.

As a temporary fix I use this #247 (review)

Note that the PR is not merged it still uses the broken version: https://github.com/fastify/fastify-secure-session/blob/main/package.json#L77

Not sure how you want to deal with it, from my side I am ok with the work around of overwriting.

TBH I would not leave it though at the current expression ^4.0.10. Either it should be fixed for the lower version as in the PR or if there is a newer version that fixes it I would upgrade the dependency to be greater or equal to that version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants