Latest Etherpad Packaging

34 views
Skip to first unread message

Lakshay Chopra

unread,
Sep 21, 2020, 5:27:38 AM9/21/20
to Sandstorm Development
Hello sandstorm devs,

I have been working on the packaging of the latest etherpad from past
few 3-4 days. I have cloned the kenton's etherpad repository and then
pulled the latest changes into it.
Currently it is on version 1.85, now after cleaning all the conflicts
I got the etherpad working in dev mode.

url - http://suraj.sandcats.io:6080/grain/SvvhQPsEiNDMAorieAM6XD

Be sure to sign in to the dev account.

I have followed the raw packaging guide, now the problem I am facing
is that when I package this spk and upload the app to my sandstorm
instance and run it, i get this error message.

<q>

...** SANDSTORM SUPERVISOR: Starting up grain. Sandbox type: userns
*** Uncaught exception ***
sandstorm/sandstorm-http-bridge.c++:2878: failed: execvp(argvp[0],
argvp): No such file or directory; argvp[0] = bin/run.sh
stack: 543ccc 5e8804

</q>

It is unable to find the bin/run.sh file but it was working in dev mode.
I even checked sandstorm-files.list file and it was present there.

I was earlier thinking that it might be searching the bin in the "/"
but after reading docs I came to know that it search "." directory
first.

I am unable to predict what I am doing wrong, kindly guide me.
Thanks in advance.
If any file is needed I will provide.

--
Lakshay Chopra
Blog- codedynamo.wordpress.com

Adam Bliss

unread,
Sep 21, 2020, 9:20:27 AM9/21/20
to Lakshay Chopra, Sandstorm Development
On Mon, Sep 21, 2020, 05:27 Lakshay Chopra <lakshay...@gmail.com> wrote:

I have been working on the packaging of the latest etherpad from past
few 3-4 days. I have cloned the kenton's etherpad repository and then
pulled the latest changes into it.
Awesome! Can you link us to your repo?

It is unable to find the bin/run.sh file but it was working in dev mode.
I even checked sandstorm-files.list file and it was present there.

You're on the right track for sure. When an app works in dev mode but not after packaging, it means that `spk pack` was unable to find that file (or didn't try). One thing to check is whether "bin" might be a symlink? I've hit a similar problem when upgrading an app from an older debian image to a newer one: /bin becomes a symlink to /usr/bin, and this trips up `spk pack` somehow. I don't fully understand the problem, but if `bin` is indeed a symlink, and if it appears on its own line in `sandstorm-files.list`, try deleting that line (the one that says only `bin`) and see if that helps.

If you link us to your git repo, we can try to reproduce the problem and debug it more thoroughly.

Thanks for working on this!
--Adam

Lakshay Chopra

unread,
Sep 21, 2020, 2:32:42 PM9/21/20
to Adam Bliss, Sandstorm Development
On Mon, Sep 21, 2020 at 1:20 PM Adam Bliss <abl...@gmail.com> wrote:
>
> On Mon, Sep 21, 2020, 05:27 Lakshay Chopra <lakshay...@gmail.com> wrote:
<snip>

> Awesome! Can you link us to your repo?

Thanks for replying Adam.
Here is the link to the repo https://github.com/GreatDevelopers/etherpad-lite
Currently the default branch is etherpad-1.8.5 after the things get
stable we will merge it in sandstorm branch.

>> It is unable to find the bin/run.sh file but it was working in dev mode.
>> I even checked sandstorm-files.list file and it was present there.
>
>
> You're on the right track for sure. When an app works in dev mode but not after packaging, it means that `spk pack` was unable to find that file (or didn't try). One thing to check is whether "bin" might be a symlink? I've hit a similar problem when upgrading an app from an older debian image to a newer one: /bin becomes a symlink to /usr/bin, and this trips up `spk pack` somehow. I don't fully understand the problem, but if `bin` is indeed a symlink, and if it appears on its own line in `sandstorm-files.list`, try deleting that line (the one that says only `bin`) and see if that helps.

Thanks for your suggestion Adam, I checked the sandstorm-files.list,
there was no entry that says only `bin`.
BTW, we have also created a pull request[WIP] to kenton's repository.
https://github.com/kentonv/etherpad-lite/pull/48

> Thanks for working on this!
It's our pleasure to work for the open source community :-)

Ian Denhardt

unread,
Sep 21, 2020, 2:52:07 PM9/21/20
to Adam Bliss, Lakshay Chopra, Sandstorm Development
A couple things to check:

1. If you change bin/run.sh in sandstorm-pkgdef.capnp to /bin/run.sh
(i.e. give it an absolute path) does the behavior change? This would
still be a bit odd, but...
2. Can you confirm that the built spk actually contains the file? If you
do an spk unpack and inspect the resulting directory, is it indeed
there?
3. Does building a package work correctly on Kenton's unmodified repo
(i.e. before the upgrade)? It wouldn't shock me if there was bitrot
unrelated to your changes.

-Ian

Quoting Lakshay Chopra (2020-09-21 14:32:28)
> --
> You received this message because you are subscribed to the Google Groups "Sandstorm Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sandstorm-de...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sandstorm-dev/CAH2WA37L1FED_ZUPDhOA_8k3_Y7ZepCb7dBzJDfNceCinfw44A%40mail.gmail.com.

Lakshay Chopra

unread,
Sep 22, 2020, 1:02:32 AM9/22/20
to Ian Denhardt, Sandstorm Development
On Mon, Sep 21, 2020 at 6:52 PM Ian Denhardt <i...@zenhack.net> wrote:
>
> A couple things to check:
>
> 1. If you change bin/run.sh in sandstorm-pkgdef.capnp to /bin/run.sh
> (i.e. give it an absolute path) does the behavior change? This would
> still be a bit odd, but...

Tried it and the results are the same.

> 2. Can you confirm that the built spk actually contains the file? If you
> do an spk unpack and inspect the resulting directory, is it indeed
> there?

Did spk unpack and in the bin folder run.sh file is present.

> 3. Does building a package work correctly on Kenton's unmodified repo
> (i.e. before the upgrade)? It wouldn't shock me if there was bitrot
> unrelated to your changes.

I actually tried it but I was getting errors related to capnproto.
The dependencies listed for that package are a bit old and need
downgrade in order to check if the package is working.
Also some node_modules were deprecated.
If required I will have a deep look at it and try to run kenton's etherpad.

Lakshay Chopra

unread,
Sep 22, 2020, 3:25:47 AM9/22/20
to Ian Denhardt, Sandstorm Development
On Tue, Sep 22, 2020 at 10:32 AM Lakshay Chopra
<lakshay...@gmail.com> wrote:
>
> On Mon, Sep 21, 2020 at 6:52 PM Ian Denhardt <i...@zenhack.net> wrote:
> >
> > A couple things to check:

<snip>

> > 2. Can you confirm that the built spk actually contains the file? If you
> > do an spk unpack and inspect the resulting directory, is it indeed
> > there?
>
> Did spk unpack and in the bin folder run.sh file is present.

Today I tried the following changes,
I renamed the bin folder in etherpad-lite dir to bin-eth so it might
not conflict with the bin folder in "/"
Changed accordingly in sandstrom-pkgdef.capnp files.
After running spk dev, sandstorm-files.list was generated. I checked
and the bin-eth/run.sh file was present.
After that I ran spk pack, now that packaged app still showed this error

<q>

...** SANDSTORM SUPERVISOR: Starting up grain. Sandbox type: userns
*** Uncaught exception ***
sandstorm/sandstorm-http-bridge.c++:2878: failed: execvp(argvp[0],
argvp): No such file or directory; argvp[0] = bin-eth/run.sh
stack: 543ccc 5e8804

</q>


I did spk unpack and checked /bin-eth/run.sh file was present.
Next I did changes in sandstrom-pkgdef.capnp and changed line
argv = ["/sandstorm-http-bridge", "9001", "--", "bin-eth/run.sh"],
to
argv = ["/sandstorm-http-bridge", "9001", "--", "/bin-eth/run.sh"],

and again packed it, but the results were the same.

I am unable to infer why spk pack or sandstorm-http-bridge is unable
to find that file while it is there. Why is it showing this behaviour?

Adam Bliss

unread,
Sep 22, 2020, 8:56:18 AM9/22/20
to Lakshay Chopra, Ian Denhardt, Sandstorm Development
On Tue, Sep 22, 2020, 03:25 Lakshay Chopra <lakshay...@gmail.com> wrote:
argvp): No such file or directory; argvp[0] = bin-eth/run.sh
stack: 543ccc 5e8804
argv = ["/sandstorm-http-bridge", "9001", "--", "bin-eth/run.sh"],

Strange! But then again, execvp can also return ENOENT if the file itself is present, but its interpreter is not. It looks like `run.sh` starts with `#!/bin/sh`. Can you check that `/bin/sh` is in the pack? If not, check whether `/bin` (not `bin`) is a perhaps a symlink? Or maybe try renaming the app's `bin` directory to something else, in case it's colliding with the system's `/bin` that houses `/bin/sh`?

--Adam

Troy Farrell

unread,
Sep 22, 2020, 11:39:45 PM9/22/20
to Sandstorm Development
I took a look at the repository, but I couldn't get node-capnp to build in bin/installDeps.sh.

In my experience updating the sandstorm-rawapi-example-rust repository to work with vagrant-spk, relative paths simply stopped working at some point.  (I suspect it was related to switching the version of Debian used by the grains, but I never investigated.)

I would try changing argv to

["/sandstorm-http-bridge", "9001", "--", "/bin/bash", "/opt/app/bin/run.sh"],

or

["/sandstorm-http-bridge", "9001", "--", "/bin/bash", "/bin/run.sh"],

depending on how you're setting up the package.

Lakshay Chopra

unread,
Sep 23, 2020, 10:49:44 AM9/23/20
to Troy Farrell, Sandstorm Development
On Wed, Sep 23, 2020 at 9:09 AM Troy Farrell <troyjf...@gmail.com> wrote:
>
> I took a look at the repository, but I couldn't get node-capnp to build in bin/installDeps.sh.

In my case building it with node12 worked but node10 was giving errors.

> In my experience updating the sandstorm-rawapi-example-rust repository to work with vagrant-spk, relative paths simply stopped working at some point. (I suspect it was related to switching the version of Debian used by the grains, but I never investigated.)
>
> I would try changing argv to
>
> ["/sandstorm-http-bridge", "9001", "--", "/bin/bash", "/opt/app/bin/run.sh"],
>
> or
>
> ["/sandstorm-http-bridge", "9001", "--", "/bin/bash", "/bin/run.sh"],
>
> depending on how you're setting up the package.

Tried but then it started to show `no file or directory /bin/sh`,
although it was there after unpacking.
Reply all
Reply to author
Forward
0 new messages