Twig template manager error on AWS Cloud - amazon-web-services

I hope I find somebody who knows the Twig in details. I've developed several sites with Twig and I'm really satisfied. Now I'm trying to put the website into an AWS cloud. Generally it works fine, but sometimes after a new deploy I get the following error message:
Fatal error: Class 'Twig_TokenParser_If' not found in /var/www/html/lib/twig/lib /Twig/Extension/Core.php on line 99 Call Stack: 0.0001 633192 1. {main}() /var/www/html/index.php:0 0.1184 1516544 2. Twig_Environment->render() /var/www/html/index.php:13 0.1184 1516544 3. Twig_Environment->loadTemplate() /var/www/html/lib/twig/lib/Twig/Environment.php:283 0.1186 1518664 4. Twig_Environment->compileSource() /var/www/html/lib/twig/lib/Twig/Environment.php:314 0.1228 1692688 5. Twig_Environment->parse() /var/www/html/lib/twig/lib/Twig/Environment.php:523 0.1231 1713752 6. Twig_Parser->parse() /var/www/html/lib/twig/lib/Twig/Environment.php:473 0.1231 1715296 7. Twig_Environment->getTokenParsers() /var/www/html/lib/twig/lib/Twig/Parser.php:74 0.1233 1731256 8. Twig_Extension_Core->getTokenParsers() /var/www/html/lib/twig/lib/Twig/Environment.php:694
If I set up a new environment in the cloud and I deploy exactly the same application(all files are the same), it works. I don't want to set everything on a new release.
If somebody knows what could be the error, please help me.
Thanks

Related

How to get Instance name in CommandBox CF 2018?

I recently started using commandBox to run ColdFusion in my local environment. After I played around for a while one issue I run into was related to adminapi. Here is the code that I use in one of my projects:
adminObj = createObject("component","cfide.adminapi.runtime");
instance = adminObj.getInstanceName();
This code is pretty straight forward and work just fine if I install traditional ColdFusion Developer version on my machine. I tried running this on commandBox: "app":{ "cfengine":"adobe#2018.0.7" }
After I run the code above this is the error message I got:
Object Instantiation Exception.
Class not found: com.adobe.coldfusion.entman.ProcessServer
The first debugging step was to check if component exists. I simply checked that like this:
adminObj = createObject("component","cfide.adminapi.runtime");
writeDump(adminObj);
The result I got on the screen was this:
component CFIDE.adminapi.runtime
extends CFIDE.adminapi.base
METHODS
Then I tried this to make sure method exists in the scope:
adminObj = createObject("component","cfide.adminapi.runtime");
writeDump(adminObj.getInstanceName);
The output looks like this, and that confirmed that method getInstanceName exists.
function getInstanceName
Arguments: none
ReturnType: any
Roles:
Access: public
Output: false
DisplayName:
Hint: returns the current instance name
Description:
The error is occurring only if I call the function getInstanceName(). Does anyone know what could be the reason of this error? Is there any solution for this particular problem? Like I already mentioned this method works in traditional ColdFusion 2018 developer environment. Thank you.
This is a bug in Adobe ColdFusion. The CFC you're creating is trying to create an instance of a specific Java class. I recognize the class name com.adobe.coldfusion.entman.ProcessServer as being related to their enterprise manager which controls features only available in certain versions of CF as well as features only available on their "standard" Tomcat installation (as opposed to a J2E deployment like CommandBox).
Please report this to Adobe in the Adobe bug tracker as they appear to be incorrectly detecting the servlet installation. I worked with them a couple years ago to improve their servlet detection on CommandBox, but I guess they still have some issues.
As a workaround, you could try and find out what jar that class is from on a non-CommandBox installation of Adobe ColdFusion and add it to the path, but I can't promise that it will work and that it won't have negative consequences.

laravel 5.5 email-verification with josiasmontag package FatalThrowableError

I have installed laravel 5.5 and implementing
I have pulled in composer require josiasmontag/laravel-email-verification and everything seems to ok but when a user register or when I click the register I get
Type error: Argument 1 passed to
Lunaweb\EmailVerification\EmailVerification::createToken() must be an
instance of Lunaweb\EmailVerification\Contracts\CanVerifyEmail,
instance of App\User given, called in
/Users/sam/site/vendor/josiasmontag/laravel-email-
verification/src/EmailVerification.php on line 127
here is the link to the parkage
https://github.com/josiasmontag/laravel-email-verification
I am not really good at php, if anyone has experience with it, please help
ahh, I forgot to implements CanVerifyEmailContract in the User model.
now it works fine.

addCookie method throws 'addCookie called with non-cookie parameter'

I am struggling with this error message which has no direct forum discussion anywhere. From some of the things I saw around the web I tried:
Changing localhost to 127.0.0.1
Played around with browser.driver.manage() v/s browser.manage()
Cleaning out/updating my node modules
The same code runs on other machines with same configuration (Win 10, chromedriver 2 etc.)
The code essetially gets the cookie value through API calls before
and uses it as such:
browser.get(URL);
browser.manage().addCookie('cookie_name', value);
Any help would be appreciated!
Assumption that you are on Protractor 5.0.0. Adding cookies have been changed in selenium webdriver 3 and was noted as a breaking change in the Protractor changelog:
Before:
browser.manage().addCookie('testcookie', 'Jane-1234');
After:
browser.manage().addCookie({name:'testcookie', value: 'Jane-1234'});
The answer above did not work for me because i kept getting this error:
"Expected 2-6 arguments but got 1"
This is what I had to do to make it compile at least:
(browser.manage() as any).addCookie({name:'cookieName', value: 'cookieVal'});
Here is the thread I got this info from:
https://github.com/angular/protractor/issues/4148
It is still an open issue.

Symfony2 + DataFixtures + Capifony - FATAL ERROR Doctrine Proxies - Cannot redeclare unserialize()

For 2 weeks i'm struggling with fallowing problem.
Im using DataFixturesBundle to load my fixtures to database. Everything works fine.
I decided to use capifony (capistrano) to deploy my application on production.
That went well too. I have implemented all things i wanted capifony to do for me with my app on production server.
But I do get one error and I dont even know what bundle is causing that.
IMPORTANT This error only shows on production server, it does NOT matter if i'm on DEV or PROD environment ( also DEBUG ), but the error never shows on my local hosts (tested on 2 computers, mac & win ).
Fatal error: Cannot redeclare Proxies\TestBundleEntityPartnerProxy::unserialize() in /public_path/testapp.com/app/releases/20110929191120/app/cache/dev/doctrine/orm/Proxies/TestBundleEntityPartnerProxy.php on line 489
And that is right. Doctrine makes two the same methods both for unserialize() and both for serialize() in the same class (proxy).
This only happens on my production server. I can't even make the problem shows on my local host. On my local host there are no two methods with the same name (unserialize() and serialize()). There is one unserialize() and one serialize()
Any help would be appreciated.
Cheers, Bart
fixed here:
https://github.com/doctrine/doctrine2/pull/177
This is not capifony, but some edge case bug or situation. I'm not sure what's causing it yet. Some details here:
http://groups.google.com/group/symfony-devs/browse_thread/thread/435a19119e9d6bdb

Firing up a cluster using whirr

I'm new to whirr and AWS so apologies in advance if I'm asking something silly.
I'm following the directions here to set up whirr and
bin/whirr launch-cluster --config hadoop.properties
fails with the following:
[~/src/cloudera/whirr-0.1.0+23]$ bin/whirr version rvm:ruby-1.8.7-p299
Apache Whirr 0.1.0+23
[~/src/cloudera/whirr-0.1.0+23]$ bin/whirr launch-cluster --config hadoop.properties rvm:ruby-1.8.7-p299
Launching myhadoopcluster cluster
Exception in thread "main" com.google.inject.CreationException: Guice creation errors:
1) No implementation for java.lang.String annotated with #com.google.inject.name.Named(value=jclouds.credential) was bound.
while locating java.lang.String annotated with #com.google.inject.name.Named(value=jclouds.credential)
for parameter 2 at org.jclouds.aws.filters.FormSigner.<init>(FormSigner.java:91)
at org.jclouds.aws.config.AWSFormSigningRestClientModule.provideRequestSigner(AWSFormSigningRestClientModule.java:66)
1 error
at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:410)
at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:166)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:118)
at com.google.inject.InjectorBuilder.build(InjectorBuilder.java:100)
at com.google.inject.Guice.createInjector(Guice.java:95)
at com.google.inject.Guice.createInjector(Guice.java:72)
at org.jclouds.rest.RestContextBuilder.buildInjector(RestContextBuilder.java:141)
at org.jclouds.compute.ComputeServiceContextBuilder.buildInjector(ComputeServiceContextBuilder.java:53)
at org.jclouds.aws.ec2.EC2ContextBuilder.buildInjector(EC2ContextBuilder.java:101)
at org.jclouds.compute.ComputeServiceContextBuilder.buildComputeServiceContext(ComputeServiceContextBuilder.java:66)
at org.jclouds.compute.ComputeServiceContextFactory.buildContextUnwrappingExceptions(ComputeServiceContextFactory.java:72)
at org.jclouds.compute.ComputeServiceContextFactory.createContext(ComputeServiceContextFactory.java:114)
at org.apache.whirr.service.ComputeServiceContextBuilder.build(ComputeServiceContextBuilder.java:41)
at org.apache.whirr.service.hadoop.HadoopService.launchCluster(HadoopService.java:84)
at org.apache.whirr.service.hadoop.HadoopService.launchCluster(HadoopService.java:61)
at org.apache.whirr.cli.command.LaunchClusterCommand.run(LaunchClusterCommand.java:61)
at org.apache.whirr.cli.Main.run(Main.java:65)
at org.apache.whirr.cli.Main.main(Main.java:91)
My hadoop.properties file has an AWS Access Key and Secret Access Key.
Any pointers on what I might have done wrong and what I need to do to fix this?
Thanks!
Okay so this appears to be a problem with the syntax in my hadoop.properties file. In the process of copying my keys across from the AWS management console, "Whirr.credential" got truncated to "Whirr.cred."
A classic face palm moment!
Anyway, leaving this up so that anyone googling for this error message knows to go triple check their hadoop.properties file!