ELF binary type "0" not known.

Today I've invested some time to bring back to life my personal Cloud storage. The reason for his death was upgrade to PHP8. So after some research I've found that at this moment the only  compatible to that php version was NextCloud 21. I have made an quick migration from ownCloud to NextCloud 21 ( RC2 ), till next ownCloud release.

I have been surprised that ownCloud are not talking for php8 compatibility - so latter you will fid the reason for this ...

Check the downloaded file what kind is:

$ file ocis
ocis: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, Go BuildID=Q1QARbCPb-T4jvNx_o5P/_h2AG0yzdDeW_AGAAQUy/xF9-8aLfT93eA51lKJg7/fnNkWegdotRsUI2zrKyc, stripped

When I executed it starnge error is showing:

$ ./ocis -h
ELF binary type "0" not known.
-sh: ./ocis: Exec format error

I have checked that linux emulation modules are up and running in kernel space:

$ kldstat
Id Refs Address Size Name
1 65 0xffffffff80200000 228e368 kernel
2 1 0xffffffff82490000 a938 cuse.ko
3 1 0xffffffff8249b000 ff18 carp.ko
4 1 0xffffffff824ab000 2ba0 coretemp.ko
5 1 0xffffffff824ae000 3be278 zfs.ko
6 2 0xffffffff8286d000 a468 opensolaris.ko
7 1 0xffffffff836fa000 5688 linprocfs.ko
8 4 0xffffffff83700000 4bb0 linux_common.ko
9 1 0xffffffff83705000 1f3c linsysfs.ko
10 1 0xffffffff83707000 8b30 tmpfs.ko
11 1 0xffffffff83710000 2130 acpi_wmi.ko
12 1 0xffffffff83713000 4240 ng_ubt.ko
13 6 0xffffffff83718000 9b60 netgraph.ko
14 2 0xffffffff83722000 90f8 ng_hci.ko
15 3 0xffffffff8372c000 9b0 ng_bluetooth.ko
16 1 0xffffffff8372d000 cae0 ng_l2cap.ko
17 1 0xffffffff8373a000 1aef0 ng_btsocket.ko
18 1 0xffffffff83755000 2140 ng_socket.ko
19 1 0xffffffff83758000 25650 ipfw.ko
20 1 0xffffffff8377e000 acf mac_ntpd.ko
21 1 0xffffffff8377f000 35e60 linux64.ko
22 1 0xffffffff837b5000 3c670 linux.ko

I have checked what kind of ELF applications are available for execution in that kernel:

$ brandelf -l
known ELF types are: FreeBSD(9) Linux(3) Solaris(6) SVR4(0)

It looks that we must tell to FreeBSD that this "ocis" file is Linux kind ELF binary. To do this I used command:

$ brandelf -t Linux ocis

And now our example application is runing as we expected:

$ ./ocis -h
Incorrect Usage. flag: help requested

NAME:
ocis - ownCloud Infinite Scale Stack

USAGE:
ocis [global options] command [command options] [arguments...]

VERSION:
1.1.0

AUTHOR:
ownCloud GmbH support@owncloud.com

In my example I have used linux application named "ocis". In fact this is application from excelent ownCloud platform - it is part from their next generation cloud platform named "ownCloud Infinite Scale". I believe that this will be better version for "Cloud Platform" from performance, scalability and security perspective. The next "Infine Scale" version as it is visible from file information is written on go language.

I hope that "ownCloud GmbH" will respect users not only in linux world - they are currently providing precompiled binaries only for linux and also docker images. But as you know actually there are also many other great UNIXes like BSD clones (Free/Net/Open BSD), Solaris ( Oracle, illumos,  openindiana ).

Share with Me via Nextcloud