Lua: error loading module file not found - linux

I'm trying to set up Lighttpd + lua + fastcgi to run web interface on an embedded MIPS board. But the important part here, I guess is Lua.
When trying to run /usr/local/bin/wsapi.fcgi (which is lua script) I get this error:
/usr/bin/lua: error loading module 'lfcgi' from file '/usr/local/lib/lua/5.1/lfcgi.so':
File not found
stack traceback:
[C]: ?
[C]: in function 'require'
/usr/local/share/lua/5.1/wsapi/fastcgi.lua:9: in main chunk
[C]: in function 'require'
/usr/local/bin/wsapi.fcgi:9: in main chunk
[C]: ?
Which is really strange, because ls shows that file is there and all permissions are ok:
# ls -l /usr/local/lib/lua/5.1/lfcgi.so
-rwxr-xr-x 1 0 0 21152 /usr/local/lib/lua/5.1/lfcgi.so
And which is more frustrating, if I actually remove the file, lua shows a different error, which means that first error wasn't really caused by lua unable to locate file properly.
So I'm a bit lost here, looks like the error message is misleading and problem isn't really the file being not found, but what...
P.S. The error comes from file wsapi/fastcgi.lua, from line 9 which looks like this:
local lfcgi = require"lfcgi"
- maybe there is something wrong with require syntax? I'm no expert in lua so I can't tell.

Ok, I figured it out. It turned out to be a missing dependency, as #Ctx suggested.
readelf -d lfcgi.so | grep NEEDED
shows that it needs libfcgi.so.0 which is a symlink to libfcgi.so and I only have the last one, not the symlink.
After creating the symlink it is working now (actually it comes with another error, but it is a different story :P).
By the way - the error message is really confusing - it looks like the file lfcgi.so is missing, when in fact it is one of its dependencies that is causing the problem.

Related

Linux:load error:No such file or directory

I am deploying a web server, and after I finish compiling.There are the executing documents;
01client.c client epoll_server.c server
Then I try to run server
./server
There is an error which I cant fix it. I have search ways for solving but still can't fix it.
load error: No such file or directory
Maybe some one can help me,please!
Thanks a lot!!!!
System utilities print the program generating the error at the beginning of the line followed by other useful information such as the name of the missing file, so this is probably an error from a user program. I can duplicate the error as follows:
errno = 2;
perror("load error");
which prints:
load error: No such file or directory
Look for the perror line in the server code. If it isn't clear what file it can't find, print the string from the failed command it is reporting.

Invalid Escape Sequence in Nmap NSE Lua Script "\."

I recently had a need for a Drupal fingerprint NSE script for an engagement. Through some research I stumbled upon a promising NSE Lua script to get the job done. Unfortunately, it seems like the author ceased the support for this script and the script was never officially incorporated into the Nmap NSE library. I decided to try and use the script anyways.
Upon attempting to run the script via the Nmap engine, I encountered an "invalid escape sequence" error. Not possessing any Lua programming experience, this error stopped me dead in my tracks. I am hoping someone with Lua experience would be able to help troubleshoot what looks like may be a pretty simple fix to the problem.
The error code is as follows:
root#kali:~# nmap --script=http-drupal-fingerprint.nse --script-args http-drupal-fingerprint.base-url=/ www.placeholder.com
Starting Nmap 7.70 ( https://nmap.org ) at 2018-09-26 12:33 EDT
NSE: failed to initialize the script engine:
/usr/bin/../share/nmap/nse_main.lua:259: /usr/bin/../share/nmap/scripts/http-drupal-fingerprint.nse:47: invalid escape sequence near '"Drupal [4-7].'
stack traceback:
[C]: in function 'assert'
/usr/bin/../share/nmap/nse_main.lua:259: in upvalue 'loadscript'
/usr/bin/../share/nmap/nse_main.lua:601: in field 'new'
/usr/bin/../share/nmap/nse_main.lua:828: in local 'get_chosen_scripts'
/usr/bin/../share/nmap/nse_main.lua:1315: in main chunk
[C]: in ?
QUITTING!
The script was imported into the NSE library as so:
curl -ksL https://raw.githubusercontent.com/r3dh4nds/NSE-Drupal-Fingerprint/master/http-drupal-fingerprint.nse >> /usr/share/nmap/scripts/http-drupal-fingerprint.nse && chmod 0644 /usr/share/nmap/scripts/http-drupal-fingerprint.nse
I am including the original source of the script from SecLists:
https://seclists.org/nmap-dev/2011/q2/490
Any help much appreciated! (Sorry if this question is somehow not formatted correctly, first post)
Drupal detection in Nmap is now done with the http-enum script. You can add --script-args http-enum.category=cms to limit the number of enumeration probes sent to only those which would detect Drupal. You may also be interested in the http-drupal-enum and http-drupal-enum-users scripts, as well as http-form-brute which can brute-force Drupal authentication.
As I suspected it was a simple fix. Removed the invalid escape sequences at:
local expression = "Drupal [4-7]\.[0-9][0-9]?\.?[0-9], "
to
local expression = "Drupal [4-7].[0-9][0-9]?.?[0-9], "
and got rid of that error.

Win10: ASDF can't load system (ASDF_OUTPUT_TRANSLATION error)

Update 2
I think #faré is right, it's an output translation problem.
So I declared the evironment variable ASDF_OUTPUT_TRANSLATIONS and set it to E:/. Now (asdf:require-system "my-system") yields a different error: Uneven number of components in source to destination mapping: "E:/" which led me to this SO-topic.
Unfortunately, his solution doesn't work for me. So I tried the other answer and set ASDF_OUTPUT_TRANSLATIONS to (:output-translations (t "E:/")). Now I get yet another error:
Invalid source registry (:OUTPUT-TRANSLATIONS (T "E:/")).
One and only one of
:INHERIT-CONFIGURATION or
:IGNORE-INHERITED-CONFIGURATION
is required.
(will be skipped)
Original Posting
I have a simple system definition but can't get ASDF to load it.
(asdf-version 3.1.5, sbcl 1.3.12 (upgraded to 1.3.18 AMD64), slime 2.19, Windows 10)
What I have tried so far
Following the ASDF manual: "4.1 Configuring ASDF to find your systems"
There it says:
For Windows users, and starting with ASDF 3.1.5, start from your
%LOCALAPPDATA%, which is usually ~/AppData/Local/ (but you can ask in
a CMD.EXE terminal echo %LOCALAPPDATA% to make sure) and underneath
create a subpath config/common-lisp/source-registry.conf.d/
That's exactly what I did:
Echoing %LOCALAPPDATA% which evaluates to C:\Users\my-username\AppData\Local
Underneath I created the subfolders config\common-lisp\source-registry.conf.d\ (In total: C:\Users\my-username\AppData\Local\config\common-lisp\source-registry.conf.d\
The manual continues:
there create a file with any name of your choice but with the type conf, for instance 50-luser-lisp.conf; in this file, add the following line to tell ASDF to recursively scan all the subdirectories under /home/luser/lisp/ for .asd files: (:tree "/home/luser/lisp/")
That’s enough. You may replace /home/luser/lisp/ by wherever you want to install your source code.
In the source-registry.conf.d folder I created the file my.conf and put in it (:tree "C:/Users/my-username/my-systems/"). This folder contains a my-system.asd.
And here comes the weird part:
If I now type (asdf:require-system "my-system") in the REPL I get the following error:
Can't create directory C:\Users\my-username\AppData\Local\common-lisp\sbcl-1.3.12-win-x86\C\Users\my-username\my-systems\C:\
So the problem is not that ASDF doesn't find the file, it does -- but (whatever the reason) it tries to create a really weird subfolder hierarchy which ultimately fails because at the end it tries to create the folder C: but Windows doesn't allow foldernames containing a colon.
Another approach: (push path asdf:*central-registry*)
If I try
> (push #P"C:/Users/my-username/my-systems/" asdf:*central-registry*)
(#P"C:/Users/my-username/my-systems/"
#P"C:/Users/my-username/AppData/Roaming/quicklisp/quicklisp/")
> (asdf:require-system "my-system")
I get the exact same error.
I don't know what to do.
Update
Because of the nature of the weird path ASDF was trying to create I thought maybe I could bypass the problem by specifying a relative path instead of an absolute one.
So I tried
  (:tree "\\Users\\my-username\\my-systems")
in my conf file. Still the same error.
Ahem. It looks like an output-translations problem.
I don't have a Windows machine right now, but this all used to work last time I tried.
Can you setup some ad hoc output-translations for now that will make it work?

erlang zip:unzip/1 {error, bad_central_directory} and {error, bad_eocd}

I have always used erlang stdlib library zip:unzip/1 successfully. Last night i hit a bar with this error:
E:\WimaxStatsParser-1.1>erl
Eshell V5.9.2 (abort with ^G)
1> zip:unzip("e:/WimaxStatsParser-1.1/in/SomeZipFile.zip").
{error,bad_central_directory}
2>
Some one help explain the cause for this ? and how i get around it ?
ADDITIONS
I got some other error on another file: {error,bad_eocd}. Please explain this as well.
I am not able to reproduce your problem with the information you give. There are 2 functions that may send this error:
get_cd_loop/5 and get_name_extra_comment/4 in stdlib-1.18.2/src/zip.erl .
it should be easy to debug
copy the file zip.erl, zip.hrl, file.hrl in a working directory,
compile with debug_info option, you will get the error message "Can't load module that resides in sticky dir", leave the VM
copy zip.beam in the stdlib.../ebin
restart the VM in the working directory, you can now add breakpoint in the zip.erl source.
BR
Pascal.

Kohana framework Fatal error mystery

I got a fatal error at auto_load function. See the following error, indicating that the specific directory and file '/mnt/webDir/www/sossage/system/classes/kohna/log.php' file failed opening required. Yes, file doesn't exist. Its's wrong path.
But, I never write the code, also can't find anywhere using 'find' option on my web root.
Fatal error: Kohana_Core::auto_load(): Failed opening required '/mnt/webDir/www/mysite/system/classes/kohna/log.php' (include_path='.:/usr/share/php:/usr/share/pear') in /mnt/webDir/mysite/system/classes/kohana/core.php on line 418, referer:
How can I solve the problem, please let me know the solution or tips.
Thanks.
You've got a typo in your configuration, likely. Note the directory it's attempting to access:
...system/classes/kohna/log.php
"kohna" is not the appropriate spelling. The directory is instead:
...system/classes/kohana/

Resources