"Unhandled stream error in pipe" and "ENOTDIR: not a directory, open" when running Gulp - node.js

I'm running a laravel application on homestead on a windows 8 machine.
I use gulp, elixix and node.js to compile resource files like SASS and .js files.
When I run the gulp command, I/O errors occur:
Saving To...
- ../www/css/admin.css
stream.js:74
throw er; // Unhandled stream error in pipe.
^
Error: ENOTDIR: not a directory, open '/home/vagrant/projects/site/www/css/admin.css'
at Error (native)

The problem arises when I enable NFS on homestead.
The fix that worked for me was to disable NFS (temporarily) in the homestead.yaml file :
folders:
- map: C:\projects
to: /home/vagrant/projects
#type: nfs -->> comment these lines
#mount_options: [nolock,vers=3,udp,noatime,actimeo=1] -->> comment these lines
run vagrant reload --provision to apply the changes and run gulp again.
I spent hours finding a fix for this, I hope this can save some users the frustration.

Related

OAS 5.5.0 - error while start obips1 service

I installed Oracle Analytics Server 5.5.0.
I configured it and run services. AdminServer and bi_server1 it's working ok.
But when I want run other process I have problem...I try run obips1 like:
./start.sh -i obips1
In obips1out I fin error like:
/u01/app/oracle/product/fmwbi_oas/bi/bifoundation/web/bin/sawserver: error while loading shared libraries: libsawhttpserver643r.so: cannot open shared object file: No such file or directory
File 'libsawhttpserver643r.so' exist in location: /u01/app/oracle/product/fmwbi_oas/bi/bifoundation/web/bin
And sawserver should see this file
Can anyone know why I get this error?
I installed OBIEE12 and I do not have this error, but in OAS 5.5.0 I get this error for first time.
I solved problem - this is a permission problem to directory with libraries.
But at now, when I start proces I get different error:
[2020-07-13T10:41:02.838+02:00] [OBIS] [NOTIFICATION:1] [] [] [ecid: ] [sik: ] [tid: 8c3e8720] [nQSError: 46136] Could not load CSF library libnqcsfwrapper64.so
What's wrong?

nodejs exec command fails for some windows commands with no clear error message

I have an editor in my program and dynamically write commands and execute them. I want to move all files and folders inside myPublish directory to current directory by child_process exec. I use robocopy command in windows. when I test robocopy in cmd, it works correctly:
robocopy /s .\myPublish .\ /move
but in program, nodejs gives an unclear error message that just says:
"Command failed: robocopy /s .\myPublish .\ /move\n"
I've just hit this issue also. While most console applications should return an exit code of zero when there's no errors, robocopy has a series of custom exit codes. This makes Node think that there's been an error during execution, when there may not have been.
As per here, Robocopy has the following exit code bits that make up the exit code:
0×10 Serious error. Robocopy did not copy any files. This is either a usage error or an error due to insufficient access privileges on the source or destination directories.
0×08 Some files or directories could not be copied (copy errors occurred and the retry limit was exceeded). Check these errors further.
0×04 Some Mismatched files or directories were detected. Examine the output log. Housekeeping is probably necessary.
0×02 Some Extra files or directories were detected. Examine the output log. Some housekeeping may be needed.
0×01 One or more files were copied successfully (that is, new files have arrived).
0×00 No errors occurred, and no copying was done. The source and destination directory trees are completely synchronized.
To fix this, you need to catch the error and inspect the error code:
const cp = require('child_process');
try {
cp.execSync('robocopy ...');
} catch (err) {
console.log(err.status); // get the return code
console.log(err.output.toString()); // get robocopy's full output
}
I think you would generally consider a code greater than 8 to be a more serious error.

Failed to start apache22

My knowledge is at a very basic level.
But I have special task for running Apache.
FreeBSD 8.1
At first, when I tried to perform command:
#apachectl start
was an error:
[warn](2) No such file or directory: Failed to enable the 'httpready' AcceptFilter
[warn](2) No such file or directory: Failed to enable the 'dataready' AcceptFilter
Then I added to the file /boot/loader.conf :
accf_http_load="YES"
accf_data_load="YES"
And when I perform
#/usr/local/etc/rc.d/apache22 start
I get this:
Performing sanity check on apache22 configuration:
Syntax OK
Starting apache22.
/usr/local/etc/rc.d/apache22: WARNING: failed to start apache22
Command:
#apachectl start
returns without any errors
In httpd-error.log I can see only this:
(21)Is a directory: httpd: could not open error log file /home/httpd-logs/hostname.example.error.log.
Unable to open logs
So the question is: How to start apache22 ?
Problem solved!
The reason was in bad extension of error log files that was written in httpd.conf for VirtualHost
That's why I saw message
(21)Is a directory: httpd: could not open error log file /home/httpd-logs/hostname.example.error.log.
Unable to open logs
in /var/log/httpd-error.log
So i just create new log files in /home/httpd-logs/ where they were all recorded

Gulp.js process working on dev by not test/prod

I have a gulp.js process using the gulp-phantom plugin that works perfectly on my dev setup, Mac OS X 10.10, however on my test / prod environment (EC2 Amazon Linux) it just doesn't work at all, however it also isn't giving any sort of error message or any other helpful output, the task just starts and finishes again almost straight away:
Dev environment output:
$ gulp crawlSite
[17:39:19] Using gulpfile ~/Documents/dev/mysite.co.uk/gulpfile.js
[17:39:19] Starting 'crawlSite'...
[17:40:15] Finished 'crawlSite' after 57 s
Test environment output:
$ gulp crawlSite
[17:34:27] Using gulpfile /var/www/html/mysite.co.uk/gulpfile.js
[17:34:27] Starting 'crawlSite'...
[17:34:27] Finished 'crawlSite' after 715 ms
As you can see on the dev environment the process takes 57 seconds however on test it is only 715 milliseconds and on test it is not creating the files that my phantom script should be creating. My gulp task is very simple:
gulp.task('crawlSite', function() {
return gulp.src("phantom-crawl-website.js")
.pipe(phantom());
});
and my phantom script "phantom-crawl-website.js" file is in the same directory as the gulpfile.js file.
I have check that all the node modules are installed and that PhantomJS is installed globally on the test environment and everything checks out ok. If I run:
$ phantomjs phantom-crawl-website.js
from the command prompt on the test environment that works fine and it crawls the site and creates the files.
I have tried to use the gulp-phantom options for "debug" however I can never seem to see any output from this. I have tried using gulp-debug as well as follows:
gulp.task('crawlSite', function() {
return gulp.src("phantom-crawl-website.js")
.pipe(phantom({debug: true}))
.pipe(debug());
});
However all this does is give me the gulp-phantom output filename ("phantom-crawl-website.txt"). I have also tried to write the gulp-phantom output file in the following way:
gulp.task('crawlSite', function() {
return gulp.src("phantom-crawl-website.js")
.pipe(phantom({debug:true}))
.pipe(gulp.dest("./phantomOutput/"));
});
But all I get from this is a blank file created in the "phantomOutput" directory called "phantom-crawl-website.txt".
Can anyone advise what I am doing wrong and how I would be able to see the phantomJS debug output so I can work out what the problem is.
Thanks so much in advance.
UPDATE
I've managed to get some output from the gulp-phantom process by adding the following to the gulp-phantom index.js file:
program.stderr.on('data', function (data) {
console.log('stderr: ' + data);
});
Once this was added I'm now getting the following error message:
stderr: Can't open '/dev/stdin'
But still no luck actually getting it to work.
Found the issue. In the gulp-phantom module there appears to be an error with it using /dev/stdin were phantomjs expecting the phantom filename to be passed. On Mac OS X the /dev/stdin contains the contents of the file but on Linux it is denied permission to read it.
To fix it I removed the line that was pushing '/dev/stdin' into the arguments stack and then added one a bit further down in the "through" function call to pass the full path and filename to the phantomjs process instead.
I will issue a pull request to the gulp-phantom module creator and see if they accept this as fix for the issue.

Error: EPERM, operation not permitted with Node.js and Etherpad Lite

I'm attempting to get an Etherpad Lite site up and running with IIS on my computer before I upload it to Azure for Web Sites, but I get this error when I try (http://pastebin.com/4rZWbqix):
iisnode encountered an error when processing the request. HRESULT: 0x2
HTTP status: 500 HTTP reason: Internal Server Error
You are receiving this HTTP 200 response because
system.webServer/iisnode/#devErrorsEnabled configuration setting is
'true'.
In addition to the log of stdout and stderr of the node.exe process,
consider using debugging and ETW traces to further diagnose the
problem.
The last 64k of the output generated by the node.exe process to stdout
and stderr is shown below: fs.js:520 return
binding.lstat(pathModule._makeLong(path));
^ Error: EPERM, operation not permitted 'C:\Users\Matthew'
at Object.fs.lstatSync (fs.js:520:18)
at Object.realpathSync (fs.js:1047:21)
at tryFile (module.js:142:15)
at Function.Module._findPath (module.js:181:18)
at Function.Module._resolveFilename (module.js:336:25)
at Function.Module._load (module.js:280:25)
at Module.runMain (module.js:492:10)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)
There is no fs.js file in Etherpad's directory, so I would assume that it's some part of Node.js that's having a problem. I'm new to Node.js, so any help would be appreciated.
EDIT 1: I'm currently looking into alternatives to Azure, and granting permissions to C:\Users\Matthew. But would it be possible to somehow modify fs.js to put a try/catch around binding.lstat?
EDIT 2: After playing around with it a little (adding the permissions worked!), I've gotten it to work. But now loading 127.0.0.1:81 returns:
iisnode encountered an error when processing the request. HRESULT: 0x2
HTTP status: 500 HTTP reason: Internal Server Error
You are receiving this HTTP 200 response because
system.webServer/iisnode/#devErrorsEnabled configuration setting is
'true'.
In addition to the log of stdout and stderr of the node.exe process,
consider using debugging and ETW traces to further diagnose the
problem.
The last 64k of the output generated by the node.exe process to stdout
and stderr is shown below:
[x1B][33m[2012-10-03 20:28:13.587] [WARN]
console - [x1B][39mNo settings file found. Continuing using defaults!
[x1B][32m[2012-10-03 20:28:14.338] [INFO] console - [x1B][39mInstalled
plugins:
It would seem like this isn't an error, since what's outputted is what's expected, but it seems to stop at plugins.formatPlugins().
Make sure the user identity associated with the IIS application pool running your node.js application has appropriate filesystem permissions to the location where you deployed your application (looks like c:\users\matthew in this case).
If you are running your app within the Default App Pool and using default IIS user, you should be able to grant necessary permissions with:
%systemdrive%\windows\system32\icacls.exe c:\users\matthew /grant IIS_IUSRS:(OI)(CI)F
Case
Error: EPERM, operation not permitted 'C:\Users\Matthew'
This error occour because the user IIS_IUSRS, does not have access to this folder C:\Users\Matthew
Resolution
You can put your application on a 'public folder', example: 'C:\Test\[yourapplication]' and gives access to user IIS_IUSRS only to this folder.
It is about permission on the folder 'C:\Users\Matthew'. Take ownership and give modify permissions.
I had the same issue, and when I tried to use the latest node version via
nvm use [some node version 10.12.0 in my case] it output that it succeed but when I run node -v it showed to me that actually I'm on a node of 8.
I solved that by login as second windows user (although they both admins and node installed on C:/) and there I use the nvm use 10.12.0 to replace the node version, and when I back login with current user it worked.
I wouldn't recommend Azure for hosting Etherpad Lite, we don't optimize for Microsoft's services, this includes Microsoft Windows. If it's an option please use linux to host your node instances, you will be much happier in my experience.

Resources