nutterpc / tg-luci

Package Files required for build of Luci
10 stars 7 forks source link

nginx broken after install #13

Closed FrancYescO closed 5 years ago

FrancYescO commented 5 years ago

If you install Luci all is working good (both nginx and uhttp/luci) but if you try to restart (so also if you reboot the device) nginx this will result broken: 500 Internal Server Error on webpage.

also uninstall will not help

and here some log that will help debug

Mon Oct  1 13:36:13 2018 daemon.err nginx: 2018/10/01 13:36:13 [error] 31900#0: *416 lua entry thread aborted: runtime error: content_by_lua(nginx.conf:109):2: loop or previous error loading module 'cards'
stack traceback:
coroutine 0:
        [C]: in function 'require'
        content_by_lua(nginx.conf:109):2: in function <content_by_lua(nginx.conf:109):1>, client: 192.168.1.77, server: localhost, request: "GET / HTTP/1.1", host: "192.168.1.1"
root@dsldevice:~# transformer
lua: /usr/bin/transformer:37: module 'uci' not found:
        no field package.preload['uci']
        no file './uci.lua'
        no file '/usr/share/lua/uci.lua'
        no file '/usr/share/lua/uci/init.lua'
        no file '/usr/lib/lua/uci.lua'
        no file '/usr/lib/lua/uci/init.lua'
        no file './uci.so'
        no file '/usr/lib/lua/uci.so'
        no file '/usr/lib/lua/loadall.so'
stack traceback:
        [C]: in function 'require'
        /usr/bin/transformer:37: in function 'do_config'
        /usr/bin/transformer:85: in main chunk
        [C]: ?
FrancYescO commented 5 years ago

after unistall and execute cp /rom/usr/lib/lua/uci.so /usr/lib/lua/ followed by nginx restart allowed me to bring nginx back online... but now i'm unable to install luci again (404 when going to 9080 port)

Ansuel commented 5 years ago

the problem is related by the fact that one depenency of luci is libuci that on our system is already installed...

Transformer use a modified version of this library... and gets replaced by the luci one

We had this same problem with dga and we discovered that the modified library is compatible with both luci and transformer so to solve this the script should restore the original library from the /rom dir

FrancYescO commented 5 years ago

@nutterpc seems the only way to have nginx and luci working good together is to recompile luci to use aa differente name of the lib: nginx/transformer will use the default uci.so and luci another that you can create and replace references in source like uci_luci.so

nutterpc commented 5 years ago

I'll have to look at it a bit later, I'm about to go take my dog in for surgery

Ansuel commented 5 years ago

so sad about that :(

anyway if you want more info

the best way to do this is modify the file in the source for

uci/lua/uci.c (from the uci repository) in that file you wil find this

define MODNAME "uci"

define METANAME MODNAME ".meta"

now we should duplicate this source to another file and name it uci_luci

anche change the MODNAME uci

add this file to the Makefile so that we will have 2 .so file (uci.so and uci_luci.so)

This way if someone needs the stock luci he have uci.so and for us that needs separate lib we have uci_luci.so

Ansuel commented 5 years ago

uci-2017-04-12.1-mod.tar.gz (you need to remove -mod from file name) This is the file modified source the generated ipk contains 2 .so file uci.so and uci_lua.so

Just put this in /dl folder

then modify the makefile in package/system/uci

with this https://pastebin.com/iHAvPfSx

and run

make package/uci/{clean,compile} V=s

the package will be in bin .....

nutterpc commented 5 years ago

Will be doing all the tickets open this weekend. Just dropped my car off for repairs

On 4 October 2018 02:14:31 GMT+09:30, Ansuel Smith notifications@github.com wrote:

uci-2017-04-12.1-mod.tar.gz

This is the file modified source the generated ipk contains 2 .so file uci.so and uci_lua.so

Just put this in /dl folder

then modify the makefile in package/system/uci

with this https://pastebin.com/iHAvPfSx

and run

make package/uci/{clean,compile} V=s

the package will be in bin .....

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/nutterpc/tg-luci/issues/13#issuecomment-426709956

-- Sent from my Android device with K-9 Mail. Please excuse my brevity.

FrancYescO commented 5 years ago

Btw @nutterpc I really hope that you are going to release all the modification you made to get Luci working, this can be very useful for these fix giving you a PR to facilitate your work, and also if we need to recompile for future updates/new boards


From: Nutterpc notifications@github.com Sent: Thursday, October 4, 2018 2:40:00 AM To: nutterpc/tg-luci Cc: Francesco M; Author Subject: Re: [nutterpc/tg-luci] nginx broken after install (#13)

Will be doing all the tickets open this weekend. Just dropped my car off for repairs

On 4 October 2018 02:14:31 GMT+09:30, Ansuel Smith notifications@github.com wrote:

uci-2017-04-12.1-mod.tar.gz

This is the file modified source the generated ipk contains 2 .so file uci.so and uci_lua.so

Just put this in /dl folder

then modify the makefile in package/system/uci

with this https://pastebin.com/iHAvPfSx

and run

make package/uci/{clean,compile} V=s

the package will be in bin .....

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/nutterpc/tg-luci/issues/13#issuecomment-426709956

-- Sent from my Android device with K-9 Mail. Please excuse my brevity.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/nutterpc/tg-luci/issues/13#issuecomment-426848241, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AEXNgfcWG8yWZ-ghgsWVUh4rkgmtg3Hyks5uhVjggaJpZM4XB_Y0.

FrancYescO commented 5 years ago

@nutterpc update us :( please give also the patch file to see all the mods you made to the source so we can help you

0jay commented 5 years ago

If you need help repairing your pc tell us what you need and soemone might be able to help

nutterpc commented 5 years ago

Sorry guys had car issues, plus my dog was in the vets a few weeks ago

On 18 October 2018 21:49:30 GMT+10:30, Oscar James notifications@github.com wrote:

If you need help repairing your pc tell us what you need and soemone might be able to help

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/nutterpc/tg-luci/issues/13#issuecomment-430971019

-- Sent from my Android device with K-9 Mail. Please excuse my brevity.

nutterpc commented 5 years ago

If you look on my other repo I host, the sources and patches are there

On 18 October 2018 21:28:00 GMT+10:30, Francesco M notifications@github.com wrote:

@nutterpc update us :( please give also the patch file to see all the mods you made to the source so we can help you

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/nutterpc/tg-luci/issues/13#issuecomment-430965748

-- Sent from my Android device with K-9 Mail. Please excuse my brevity.

FrancYescO commented 5 years ago

@nutterpc so all your edit to the source are in these 2 commits https://github.com/nutterpc/chaos_calmer/commits/chaos_calmer O.o

Ansuel commented 5 years ago

@nutterpc tell me if you need more info about my patch

nutterpc commented 5 years ago

I'm also looking and I don't see a /dl folder

On 22 October 2018 06:23:36 GMT+10:30, Ansuel Smith notifications@github.com wrote:

@nutterpc tell me if you need more info about my patch

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/nutterpc/tg-luci/issues/13#issuecomment-431698635

-- Sent from my Android device with K-9 Mail. Please excuse my brevity.

Ansuel commented 5 years ago

when you compile the openwrt package you must have a dl folder 100%

nutterpc commented 5 years ago

root@debian:/home/nutterpc/chaos_calmer# make package/uci/clean V=s -j8 make[1]: Entering directory '/home/nutterpc/chaos_calmer' make[2]: Entering directory '/home/nutterpc/chaos_calmer/package/system/uci' Makefile:91: *** missing separator. Stop.

Thats whats stopping me from compiling it atm. It says something is missing but i dont get WHAT it's missing though

nutterpc commented 5 years ago

root@debian:/home/nutterpc/chaos_calmer# make package/uci/compile V=s -j8 Collecting package info: done make[1]: Entering directory '/home/nutterpc/chaos_calmer' make[2]: Entering directory '/home/nutterpc/chaos_calmer/package/libs/toolchain' if [ -f /home/nutterpc/chaos_calmer/staging_dir/target-mips_mips32_uClibc-0.9.33.2/pkginfo/toolchain.default.install.clean ]; then rm -f /home/nutterpc/chaos_calmer/staging_dir/target-mips_mips32_uClibc-0.9.33.2/pkginfo/toolchain.default.install /home/nutterpc/chaos_calmer/staging_dir/target-mips_mips32_uClibc-0.9.33.2/pkginfo/toolchain.default.install.clean; fi; echo "libc" >> /home/nutterpc/chaos_calmer/staging_dir/target-mips_mips32_uClibc-0.9.33.2/pkginfo/toolchain.default.install if [ -f /home/nutterpc/chaos_calmer/staging_dir/target-mips_mips32_uClibc-0.9.33.2/pkginfo/toolchain.default.install.clean ]; then rm -f /home/nutterpc/chaos_calmer/staging_dir/target-mips_mips32_uClibc-0.9.33.2/pkginfo/toolchain.default.install /home/nutterpc/chaos_calmer/staging_dir/target-mips_mips32_uClibc-0.9.33.2/pkginfo/toolchain.default.install.clean; fi; echo "libgcc" >> /home/nutterpc/chaos_calmer/staging_dir/target-mips_mips32_uClibc-0.9.33.2/pkginfo/toolchain.default.install make[2]: Leaving directory '/home/nutterpc/chaos_calmer/package/libs/toolchain' make[2]: Entering directory '/home/nutterpc/chaos_calmer/package/libs/libjson-c' make[2]: Entering directory '/home/nutterpc/chaos_calmer/package/utils/lua' if [ -f /home/nutterpc/chaos_calmer/staging_dir/target-mips_mips32_uClibc-0.9.33.2/pkginfo/libjson-c.default.install.clean ]; then rm -f /home/nutterpc/chaos_calmer/staging_dir/target-mips_mips32_uClibc-0.9.33.2/pkginfo/libjson-c.default.install /home/nutterpc/chaos_calmer/staging_dir/target-mips_mips32_uClibc-0.9.33.2/pkginfo/libjson-c.default.install.clean; fi; echo "libjson-c" >> /home/nutterpc/chaos_calmer/staging_dir/target-mips_mips32_uClibc-0.9.33.2/pkginfo/libjson-c.default.install make[2]: Leaving directory '/home/nutterpc/chaos_calmer/package/libs/libjson-c' make[2]: Leaving directory '/home/nutterpc/chaos_calmer/package/utils/lua' make[2]: Entering directory '/home/nutterpc/chaos_calmer/package/libs/libubox' if [ -f /home/nutterpc/chaos_calmer/staging_dir/target-mips_mips32_uClibc-0.9.33.2/pkginfo/libubox.default.install.clean ]; then rm -f /home/nutterpc/chaos_calmer/staging_dir/target-mips_mips32_uClibc-0.9.33.2/pkginfo/libubox.default.install /home/nutterpc/chaos_calmer/staging_dir/target-mips_mips32_uClibc-0.9.33.2/pkginfo/libubox.default.install.clean; fi; echo "libubox" >> /home/nutterpc/chaos_calmer/staging_dir/target-mips_mips32_uClibc-0.9.33.2/pkginfo/libubox.default.install if [ -f /home/nutterpc/chaos_calmer/staging_dir/target-mips_mips32_uClibc-0.9.33.2/pkginfo/libubox.default.install.clean ]; then rm -f /home/nutterpc/chaos_calmer/staging_dir/target-mips_mips32_uClibc-0.9.33.2/pkginfo/libubox.default.install /home/nutterpc/chaos_calmer/staging_dir/target-mips_mips32_uClibc-0.9.33.2/pkginfo/libubox.default.install.clean; fi; echo "libblobmsg-json" >> /home/nutterpc/chaos_calmer/staging_dir/target-mips_mips32_uClibc-0.9.33.2/pkginfo/libubox.default.install if [ -f /home/nutterpc/chaos_calmer/staging_dir/target-mips_mips32_uClibc-0.9.33.2/pkginfo/libubox.default.install.clean ]; then rm -f /home/nutterpc/chaos_calmer/staging_dir/target-mips_mips32_uClibc-0.9.33.2/pkginfo/libubox.default.install /home/nutterpc/chaos_calmer/staging_dir/target-mips_mips32_uClibc-0.9.33.2/pkginfo/libubox.default.install.clean; fi; echo "jshn" >> /home/nutterpc/chaos_calmer/staging_dir/target-mips_mips32_uClibc-0.9.33.2/pkginfo/libubox.default.install if [ -f /home/nutterpc/chaos_calmer/staging_dir/target-mips_mips32_uClibc-0.9.33.2/pkginfo/libubox.default.install.clean ]; then rm -f /home/nutterpc/chaos_calmer/staging_dir/target-mips_mips32_uClibc-0.9.33.2/pkginfo/libubox.default.install /home/nutterpc/chaos_calmer/staging_dir/target-mips_mips32_uClibc-0.9.33.2/pkginfo/libubox.default.install.clean; fi; echo "libjson-script" >> /home/nutterpc/chaos_calmer/staging_dir/target-mips_mips32_uClibc-0.9.33.2/pkginfo/libubox.default.install make[2]: Leaving directory '/home/nutterpc/chaos_calmer/package/libs/libubox' make[2]: Entering directory '/home/nutterpc/chaos_calmer/package/system/uci' Makefile:87: missing separator. Stop. make[2]: Leaving directory '/home/nutterpc/chaos_calmer/package/system/uci' package/Makefile:191: recipe for target 'package/system/uci/compile' failed make[1]: [package/system/uci/compile] Error 2 make[1]: Leaving directory '/home/nutterpc/chaos_calmer' Build failed - please re-run with -j1 to see the real error message /home/nutterpc/chaos_calmer/include/toplevel.mk:181: recipe for target 'package/uci/compile' failed

nutterpc commented 5 years ago

eventually worked it out. Packages will be uploaded shortly for testing

FrancYescO commented 5 years ago

My system actually is in a pretty dirty status (starting the install script was giving me segmentation fault o.o), but i've force reinstalled with opkg packages from this repo, restarted nginx and both nginx and luci were working together

powercycled and leds stopped working (only orange info) and nginx back to error 500 Sat Oct 27 08:22:03 2018 daemon.err nginx: 2018/10/27 08:22:03 [error] 4606#0: *165 [lua] sessioncontrol.lua:79: get_datamodel_config(): failed to retrieve config: Connection refused, client: 192.168.144.5, server: localhost, request: "GET /cards.lp HTTP/1.1",

i surely need to do another try after an rtfd but cannot do now

PS. could you include the patch to get wifi working in LuCI?