markqvist / NomadNet

Communicate Freely
GNU General Public License v3.0
1.17k stars 44 forks source link

Exec format error while processing page request #7

Closed HarlekinSimplex closed 2 years ago

HarlekinSimplex commented 2 years ago

Hi Mark,

actually I am using a custom location for the nomad config and storage files. While processing a request for the index.mu page I see the following error in the log:

[Verbose] Incoming link request <39890900244f18b6d778> accepted
[Verbose] Peer connected to <nomadnetwork.node.436796059edc9fa3684c/eeda32d48d3603a6c16e>
[Debug] Handling request <a124d8f4efadfe22807f> for: /page/index.mu
[Verbose] Page request <a124d8f4efadfe22807f> for: /page/index.mu
[Verbose] Serving page: /home/bsb/.nomadnetwork/paulchen/storage/pages/index.mu
[Error] Error occurred while handling request <a124d8f4efadfe22807f> for: /page/index.mu
[Error] The contained exception was: [Errno 8] Exec format error: '/home/bsb/.nomadnetwork/paulchen/storage/pages/index.mu'

The file is there and can be read. Renaming it gives the info that the node is serving pages but index.mu is not yet available. It contains nothing else than just 'HelloWorld' and is stored as a UTF-8 file.

Any clue what might be wrong here causing that error. I did already run out of ideas what to try...

Cheers Stephan

markqvist commented 2 years ago

It looks like nomadnet is trying to execute the page to generate a dynamic response. Did you set the executable permission on the file? If the file is marked as an executable, nomadnet will treat it as such, and return whatever output the execution generates, instead of it contents.

But if your file is not actually executable in any way, it would generate an error like this.

HarlekinSimplex commented 2 years ago

LOL.

That was the problem.

It indeed was marked as executable.

Now I just need to find out how come.

Weird.

Thx!

Cheers

Stephan

Von: markqvist @.> Gesendet: Dienstag, 28. Juni 2022 16:57 An: markqvist/NomadNet @.> Cc: Stephan Becker @.>; Author @.> Betreff: Re: [markqvist/NomadNet] Exec format error while processing page request (Issue #7)

It looks like nomadnet is trying to execute the page to generate a dynamic response. Did you set the executable permission on the file? If the file is marked as an executable, nomadnet will treat it as such, and return whatever output the execution generates, instead of it contents.

But if your file is not actually executable in any way, it would generate an error like this.

— Reply to this email directly, view it on GitHub https://github.com/markqvist/NomadNet/issues/7#issuecomment-1168835486 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ABWGJMCIRE6FIDPUCWFP4STVRMHFDANCNFSM52CLSUGA . You are receiving this because you authored the thread. https://github.com/notifications/beacon/ABWGJMHRNFN4YUDKENHMW6LVRMHFDA5CNFSM52CLSUGKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOIWVQHHQ.gif Message ID: @. @.> >

markqvist commented 2 years ago

Good to hear it was as simple as that! I will just close this issue then :)

HarlekinSimplex commented 2 years ago

Just a simple question.

Is there a way to include the output of a script in the index.mu which itself is not a script?

Von: markqvist @.> Gesendet: Dienstag, 28. Juni 2022 17:20 An: markqvist/NomadNet @.> Cc: Stephan Becker @.>; Author @.> Betreff: Re: [markqvist/NomadNet] Exec format error while processing page request (Issue #7)

Good to hear it was as simple as that! I will just close this issue then :)

— Reply to this email directly, view it on GitHub https://github.com/markqvist/NomadNet/issues/7#issuecomment-1168862410 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ABWGJMCQN74OSOLFMYTFJWDVRMJZDANCNFSM52CLSUGA . You are receiving this because you authored the thread. https://github.com/notifications/beacon/ABWGJMAX3GVH4ATZ2KTBUNLVRMJZDA5CNFSM52CLSUGKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOIWVWZSQ.gif Message ID: @. @.> >

markqvist commented 2 years ago

No, unfortunately there is no way to do this, an least not internally, using only nomadnet. if you need dynamic content in the index.mu, it must be a script.

But you could get some other job to dynamically generate the index.mu every time a change is needed, for example.