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

[BUG] Railway app deployment issue (settings.yaml file missing) #175

Open
antonleviathan opened this issue Feb 5, 2023 · 4 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@antonleviathan
Copy link
Contributor

Error: ENOENT: no such file or directory, open '/app/resources/default-settings.yaml'
at Object.openSync (node:fs:600:3)
at Object.readFileSync (node:fs:468:35)
at SettingsStatic.loadAndParseYamlFile (/app/src/utils/settings.js:27:57)
at SettingsStatic.loadSettings (/app/src/utils/settings.js:53:39)
at App.createSettings [as settings] (/app/src/utils/settings.js:72:41)
at App.run (/app/src/app/app.js:34:31)
at Object.<anonymous> (/app/src/index.js:33:30)
at Module._compile (node:internal/modules/cjs/loader:1226:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1280:10)
at Module.load (node:internal/modules/cjs/loader:1089:32) {
errno: -2,
syscall: 'open',
code: 'ENOENT',
path: '/app/resources/default-settings.yaml'
}
Node.js v18.14.0
@antonleviathan antonleviathan added the bug Something isn't working label Feb 5, 2023
@antonleviathan antonleviathan self-assigned this Feb 5, 2023
@MTG2000
Copy link

MTG2000 commented Apr 27, 2023

Hey @cameri
Any updates or suggestions for how this issue could be fixed??

I was using an older version of the relay deployed on railway, but today when I updated to the latest version, I faced this error & my project is crashing & not working right now...

I tried adding this line to my Dockerfile.railwayapp file as #190 suggested:

...
WORKDIR /app


COPY --from=build /build/dist .
+ ADD resources /app/resources
+ COPY .railwayapp/settings.yaml /app/.nostr/settings.yaml

RUN npm install --omit=dev --quiet

USER 1000:1000

RUN mkdir -p $NOSTR_CONFIG_DIR

And I created a file at ./railwayapp/settings.yaml with the same content of the default-settings.yaml file.

But it's now a different error:

node:internal/fs/watchers:255
throw error;
^
Error: ENOENT: no such file or directory, watch '/home/node/.nostr/settings.yaml'
at FSWatcher.<computed> (node:internal/fs/watchers:247:19)
at Object.watch (node:fs:2343:34)
at SettingsStatic.watchSettings (/app/src/utils/settings.js:107:26)
at App.run (/app/src/app/app.js:35:51)
at Object.<anonymous> (/app/src/index.js:33:30)
at Module._compile (node:internal/modules/cjs/loader:1254:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
at Module.load (node:internal/modules/cjs/loader:1117:32)
at Module._load (node:internal/modules/cjs/loader:958:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
errno: -2,
syscall: 'watch',
code: 'ENOENT',
path: '/home/node/.nostr/settings.yaml',
filename: '/home/node/.nostr/settings.yaml'
}

It seems like it wants me to provide a custom settings file even though there is a default one...

I see in the README that in the QuickStart section, you say that we should copy default-settigs.yaml file to .nostr/settings.yaml file, is this the case here too??
Even though the .nostr folder is gitignored and it won't be uploaded??

Any advice is greatly appreciated.
Cause as I said, my relay is currently down.


@antonleviathan
Have you fixed the issue for yourself btw?

@MTG2000
Copy link

MTG2000 commented Apr 27, 2023

I fixed the issue.
The path to the settings file was incorrect.
So when I changed it to this:

COPY --from=build /build/dist .
ADD resources /app/resources

RUN mkdir -p $NOSTR_CONFIG_DIR
COPY .railwayapp/settings.yaml $NOSTR_CONFIG_DIR/settings.yaml

It worked.

HamishMacEwan added a commit to HamishMacEwan/local-nostream that referenced this issue Nov 29, 2023
@amunrarara
Copy link

I've just encountered the same issue. Trying @MTG2000 's solution now

@amunrarara
Copy link

Fixed it for me, too. Thanks @MTG2000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants