System unable to find Balanced.js when running eb deploy? - node.js

I'm trying to deploy a node server to Elastic-BeanStalk, and I get this error.
ERROR: WindowsError :: [Error 3] The system cannot find the path specified: './node_modules\restify\node_modules\bunyan\node_modules\mv\node_modules\rimraf\node_modules\glob\node_modules\minimatch\node_modules\brace-expansion\node_modules\balanced-match\test\balanced.js'
I've looked for balanced and it is there. I've been able to deploy with out this error in the past, and I don't think I have made any changes since then.

I guess you'r on a windows env in the beanstalk, and maybe not on your dev computer ?
./node_modules\restify
The / then the \ seems strange to me.

Related

Launch fails after meteor build

I am creating a build from meteor source in a docker container.
It worked well so far (since last creation 1 or 2 weeks ago) but today an exception raises !
at /home/meteor/build/bundle/programs/server/boot.js:462:11
at /home/meteor/build/bundle/programs/server/boot.js:423:13
at Function.run (/home/meteor/build/bundle/programs/server/profile.js:510:12)
at /home/meteor/build/bundle/programs/server/boot.js:464:5
at Function.time (/home/meteor/build/bundle/programs/server/profile.js:309:28)
TypeError: Object.getOwnPropertyDescriptors is not a function
at insert (packages/mongo/collection.js:435:12)
at packages/autoupdate.js:189:3
at updateVersions (packages/autoupdate.js:125:20)
throw(ex);
/home/meteor/build/bundle/programs/server/node_modules/fibers/future.js:280
NB : log may be not ordered as I use ELK stack to handle it
What happened ? And what to do to solve it ?
FYI: the application works well locally (not builded)
Node 6 is currently default in alpine, that was the issue. I switch to node image which is safer (but bigger).

Application with wrong code even after a git force push

I am under the impression that my application on Bluemix is running an older (wrong) version of the code. I have made several updates and now the application doesn't deploy nor will it start. When I check the log files, I see some errors due to Express middleware changes that are no longer supported and should be replaced by external components, for example, replace bodyParser with body-parser. I have made all these changes replacing express.middlewarename with the new components according to this page: https://github.com/senchalabs/connect#middleware
However, I am still getting error messages in the log file when I try to deploy the application. The message is:
throw new Error('Most middleware (like ' + name + ') is no longer bundled with
Express and must be installed separately. Please see
https://github.com/senchalabs/connect#middleware.');
2017/4/5 午後2時42分48秒 ERR APP at Function.Object.defineProperty.get
(/home/vcap/app/node_modules/express/lib/express.js:107:13)
2017/4/5 午後2時42分48秒 ERR APP at Module._compile (module.js:409:26)
2017/4/5 午後2時42分48秒 ERR APP at Object.Module._extensions..js (module.js:416:10)
2017/4/5 午後2時42分48秒 ERR APP at Module.load (module.js:343:32)
I am able to run the application on my machine. If I download the code from the compile pipeline, it seems fine. However, I see some errors, which point to a line of code that is a comment or a blank line in my files.
All of these issues leads me to believe that Bluemix is trying to deploy a wrong version of code.
Does anyone know how can I fix it?
Thank you in advance.
First you have make sure your all node process is killed.
On linux you can check using : ps aux|grep node.
After that rebuild your npm. using "npm build" command.
Start you server it will work.
You can do a couple of things
1. Add a git commit tag as apart of your end point. Maven and other build tools have this capability and it good practice especially for micro service architectures. Spring has one and I would be surprised if node didn't have something similar. This is what I found with a brief search. [1]
2. Trying doing a cf d ${app_name} then re-push your app.
3. If you're using a manifest file or using the cf p command make sure you specify the path to the application being deployed. There are some other nuances with node on CF but you can also assign start scripts to the build pack when the app is being deployed.
I hope this helps.
[1] https://github.com/ktoso/maven-git-commit-id-plugin/

Symfony3: Developing in Windows, Deploying in Linux. DIRECTORY-SEPARATOR

I have following problem:
I wrote a little homepage under Win10. All is fine but when I deploy my work in a Linux system I get the following message:
[2015-12-17 09:28:41] request.CRITICAL: Uncaught PHP Exception Twig_Error_Loader:
"The "/info/wwv/data/someone\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle/Resources/views" directory does not exist."
at /info/wwv/data/someone/vendor/twig/twig/lib/Twig/Loader/Filesystem.php line 94 [...]
I think there is some problem with the DIRECTORY_SEPARATOR or similar. The path exists and I can access it when I replace the backslashes with slashes.
Also my log is written in the directory app\logs instead real subdirectory app/logs.
Are you generating the cache on Windows and deploying the cache too instead of building it on the Linux server ? This is indeed not meant to work properly, due to differences between the OS.
Recent versions of Symfony allow to build the cache before deployment and copy it to the other server, but this does not work with Windows on one side and Linux on the other.
I had a similar issue. One day symfony 3.4 (on php7.2.16) stops working. After changing some path settings in AppKernel.php from '/' to '\\', everything works fine.
e.g.
public function getLogDir()
{
return dirname(__DIR__).'\\var\\logs';
}
It seems to be a windows-related issue with path-settings.
I had the same problem as my production server did not let me allocate enough ram to run composer and I had to run it locally.
Afterwards I got similar error (having wrong access path \ instead of / for linux)
Steps I took:
Replacing \\ with / in composer.json and composer.lock
Clearing the var/cache/*

Azure Websites Git Deployment dropping "/" in SCM_BUILD_ARGS

Description
We are in a current project based on MVC4/Umbraco using Azure Websites to host it.
We are using SCM_BUILD_ARGS to change between different build setups depending on which site in Azure we deploy to (Test and Prod).
This is done by defining an app setting in the UI:
SCM_BUILD_ARGS = /p:Environment=Test
Earlier we used Bitbucket Integration to deploy and here this setting worked like a champ.
We have now switched to using Git Deployment, pushing the changes from our build server when tests have passed.
But when we do this, we get a lovely error.
"MSB1008: Only one project can be specified."
Trying to redeploy the same failed deployment from the UI on Azure works though.
After some trial and error I ended going into the deploy.cmd and outputting the %SCM_BUILD_ARGS% value in the script.
It looks like the / gets dropped from SCM_BUILD_ARGS but only when using Git deploy, not Bitbucket Integration or redeploy from UI.
Workaround
As workaround I have for now added a / to the deploy.cmd script in front of the %SCM_BUILD_ARGS%, but this of course breaks redeploy, since we then have //p:Environment=Test in the MSBuild command when the value of %SCM_BUILD_ARGS% has been inserted.
:: 2. Build to the temporary path
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
:: Added / to SCM_BUILD_ARGS
%MSBUILD_PATH% "%DEPLOYMENT_SOURCE%\www\www.csproj" [....] /%SCM_BUILD_ARGS%
) ELSE (
%MSBUILD_PATH% "%DEPLOYMENT_SOURCE%\www\www.csproj" [....] /%SCM_BUILD_ARGS%
)
Question
Anyone know of a better solution for this problem or is it possibly a bug in Kudu?
We would love to have both deploy from Git and Redeploy working.
Could you try changing from "/" to "-"? For instance, AppSettings from /p:Environment=Test to -p:Environment=Test, see if it helps.
-p:Environment=Test did not work for me, the setting which worked for me at the time of this writing (September 2015) was
-p:Configuration=Test
There is clearly a Kudu bug in there, and you should open an issue on https://github.com/projectkudu/kudu. But for now, I can give you a workaround.
Instead of using an App Setting, include a .deployment file at the root of your repo, containing:
[config]
SCM_BUILD_ARGS = /p:Environment=Test
I think this will work in all cases. I suspect the bug has to do with bash messing up the environment in post receive hook scenarios, which only apply to direct git push but not to Bitbucket and Redeploy scenarios.
UPDATE: In fact, it's easy to see such weird bash behavior. Try this:
Open cmd.exe
Run: set foo=/abc to set a variable
Run bash
From bash, run cmd to launch a new cmd on top of bash (so cmd -> bash -> cmd)
Run set foo to get the value of foo
Result:
FOO=C:/Program Files (x86)/git/abc
So the value gets completely messed up. The key also gets upper cases, though that's mostly harmless. Strange stuff...

Problem with node.js and Redis-server?

I intended to implement a chat feature in my rails application. After a brief backup work I found JUGGERNAUT is the best option. By going to through http://juggernaut.rubyforge.org/
I have successfully implemented the juggernaut in my application.
Presently I'm all set to implement chat feature and after a vigorous surfing over web I couldn't get good tutorial to implement it but I found the some part of implementation at http://www.golygon.com/2010/12/private-chat-room-in-ruby-on-rails-3-0/. I decided to follow it but initially to implement the tutorial we need to have redis server and node.js in our system. I installed both in my environment.
But I'm facing the following problem as follows:
If I try
redis-server, I'm getting the following error
[11440] 08 Aug 10:08:16 # Warning: no config file specified, using the default config. In order to specify a config file use 'redis-server /path/to/redis.conf'
[11440] 08 Aug 10:08:16 # Opening port: bind: Address already in use
and as per the tutorial
if I try
sudo node server.js, I'm getting the following error
[sudo] password for re5:
node.js:63
throw e;
^
Error: ENOENT, No such file or directory '/home/re5/Documents/task17/server.js'
at Object.openSync (fs:153:18)
at Object.readFileSync (fs:94:15)
at Module._loadScriptSync (node.js:468:39)
at Module.loadSync (node.js:338:12)
at Object.runMain (node.js:522:24)
at Array.<anonymous> (node.js:756:12)
at EventEmitter._tickCallback (node.js:55:22)
at node.js:773:9
As I don't know much about the redis and node I'm unable to figure out what was the problem regarding to this errors.
I'm stuck and couldn't go further as I'm not sure whether this two are configured perfectly or not.
currently I'm using rails 3.0.7 and ruby 1.8.7
Can any one help me out.
Well your first error is quite simple to understand.
[11440] 08 Aug 10:08:16 # Opening port: bind: Address already in use
This means that there is aready a server bound to that port and using it as a server, this can happen if you have other applications/servers running or if you try to have mutiple instances of the server run at one time. To fix this you need to stop the process and then start it back up again. You can usually do this by closing all of your terminal windows or using your operating systems process manager to terminate the process, if those methods dont work for you try shutting your computer down and starting it back up. If you are still unable to start the Redis server after this then there are some more steps we can take.
The next error is due to node.js not being able to find a file that it needs. Reinstalling node.js should fix this problem for you.
Let me know if this fixes your problem or if you need more help.

Resources