Hey awesome programmers!
Glad to see you all :)
This is my site... http://www.newdelhifreeads.com
I use cpanel.
This type of question has been asked but mine is a little different.
Whenever anyone tries to register on my site or try to post a free ad, the following error message results:
Swift_Transport Exception
Failed to authenticate on SMTP server with username "info#newdelhifreeads.com" using 2 possible authenticators
/home/newdelhi/public_html/protected/modules/Core/extensions/vendors/mail/vendors/swiftMailer/classes/Swift/Transport/Esmtp/AuthHandler.php(179)
167 foreach ($this->_getAuthenticatorsForAgent() as $authenticator)
168 {
169 if (in_array(strtolower($authenticator->getAuthKeyword()),
170 array_map('strtolower', $this->_esmtpParams)))
171 {
172 $count++;
173 if ($authenticator->authenticate($agent, $this->_username, $this->_password))
174 {
175 return;
176 }
177 }
178 }
179 throw new Swift_TransportException(
180 'Failed to authenticate on SMTP server with username "' .
181 $this->_username . '" using ' . $count . ' possible authenticators'
182 );
183 }
184 }
185
186 /**
187 * Not used.
188 */
189 public function getMailParams()
190 {
191 return array();
Stack Trace
#0
– /home/newdelhi/public_html/protected/modules/Core/extensions/vendors/mail/vendors/swiftMailer/classes/Swift/Transport/EsmtpTransport.php(252): Swift_Transport_Esmtp_AuthHandler->afterEhlo(Swift_SmtpTransport)
247
248 $this->_capabilities = $this->_getCapabilities($response);
249 $this->_setHandlerParams();
250 foreach ($this->_getActiveHandlers() as $handler)
251 {
252 $handler->afterEhlo($this);
253 }
254 }
255
256 /** Overridden to add Extension support */
257 protected function _doMailFromCommand($address)
#1
– /home/newdelhi/public_html/protected/modules/Core/extensions/vendors/mail/vendors/swiftMailer/classes/Swift/Transport/AbstractSmtpTransport.php(108): Swift_Transport_EsmtpTransport->_doHeloCommand()
103 catch (Swift_TransportException $e)
104 {
105 $this->_throwException($e);
106 }
107 $this->_readGreeting();
108 $this->_doHeloCommand();
109
110 if ($evt)
111 {
112 $this->_eventDispatcher->dispatchEvent($evt, 'transportStarted');
113 }
#2
– /home/newdelhi/public_html/protected/modules/Core/extensions/vendors/mail/vendors/swiftMailer/classes/Swift/Mailer.php(74): Swift_Transport_AbstractSmtpTransport->start()
69 {
70 $failedRecipients = (array) $failedRecipients;
71
72 if (!$this->_transport->isStarted())
73 {
74 $this->_transport->start();
75 }
76
77 return $this->_transport->send($message, $failedRecipients);
78 }
79
#3
+ /home/newdelhi/public_html/protected/modules/Core/extensions/vendors/mail/YiiMail.php(133): Swift_Mailer->send(Swift_Message, array())
#4
+ /home/newdelhi/public_html/protected/modules/User/services/UserService.php(311): YiiMail->send(YiiMailMessage)
#5
+ /home/newdelhi/public_html/protected/modules/Core/extensions/base/FSM.php(106): UserService->registerInFrontEnd(array("User" => array("email" => "tips4youawesome#gmail.com", "first_name" => "Naveen", "last_name" => "Gift", "verifyCode" => "uumohu"), "btnRegister" => "Register"))
#6
+ /home/newdelhi/public_html/protected/modules/Core/extensions/base/FSM.php(133): FSM::_run("User.User.registerInFrontEnd", array("User" => array("email" => "tips4youawesome#gmail.com", "first_name" => "Naveen", "last_name" => "Gift", "verifyCode" => "uumohu"), "btnRegister" => "Register"), false)
#7
+ /home/newdelhi/public_html/protected/controllers/SiteController.php(139): FSM::run("User.User.registerInFrontEnd", array("User" => array("email" => "tips4youawesome#gmail.com", "first_name" => "Naveen", "last_name" => "Gift", "verifyCode" => "uumohu"), "btnRegister" => "Register"))
#8
+ /home/newdelhi/public_html/yii-1.1.7.r3135/framework/web/actions/CInlineAction.php(50): SiteController->actionRegister()
#9
+ /home/newdelhi/public_html/yii-1.1.7.r3135/framework/web/CController.php(300): CInlineAction->runWithParams(array())
#10
+ /home/newdelhi/public_html/yii-1.1.7.r3135/framework/web/CController.php(278): CController->runAction(CInlineAction)
#11
+ /home/newdelhi/public_html/yii-1.1.7.r3135/framework/web/CController.php(257): CController->runActionWithFilters(CInlineAction, array())
#12
+ /home/newdelhi/public_html/yii-1.1.7.r3135/framework/web/CWebApplication.php(328): CController->run("register")
#13
+ /home/newdelhi/public_html/yii-1.1.7.r3135/framework/web/CWebApplication.php(121): CWebApplication->runController("site/register")
#14
+ /home/newdelhi/public_html/yii-1.1.7.r3135/framework/base/CApplication.php(155): CWebApplication->processRequest()
#15
+ /home/`newdelhi`/public_html/`index.php`(42): `CApplication`->run()
Could anyone please help me out with this?
It would be a great help!
Thanks.......... ;)
This might be old but somebody might get help through this. I too faced the same problem and received a mail on my gmail account stating that someone is trying to hack your account through an email client or a different site.
THen I searched and found that doing below would resolve this issue.
Go to https://accounts.google.com/UnlockCaptcha
and unlock your account for access through other media/sites.
UPDATE : 2015
Also, you can try this, Go to https://myaccount.google.com/security#connectedapps
At the bottom, towards right there is an option "Allow less secure apps". If it is "OFF", turn it on by sliding the button.
Related
I just installed the SonataMediaProviderVideoBundle and all related ones.
When i try to upload a video via the sonata media backend, I have this error (Sf 3.1.5):
Catchable Fatal Error: Argument 1 passed to FFMpeg\FFProbe::__construct() must be an instance of FFMpeg\Driver\FFProbeDriver, array given, called in D:\wamp\www\test-sf3\TestSonata\var\cache\dev\appDevDebugProjectContainer.php
The array is taken from providers.yml line 41 https://github.com/xmon/SonataMediaProviderVideoBundle/blob/master/Resources/config/providers.yml
And here is the __construct which wait for the FFMpeg\Driver\FFProbeDriver instance at line 47 : on git hub -> PHP-FFMpeg/PHP-FFMpeg/blob/master/src/FFMpeg/FFProbe.php
Here is my stack trace:
Exception detected!
Catchable Fatal Error: Argument 1 passed to FFMpeg\FFProbe::__construct() must be an instance of FFMpeg\Driver\FFProbeDriver, array given, called in D:\wamp\www\test-sf3\TestSonata\var\cache\dev\appDevDebugProjectContainer.php on line 10246 and defined
500 Internal Server Error - ContextErrorException
Stack Trace
in vendor\php-ffmpeg\php-ffmpeg\src\FFMpeg\FFProbe.php at line 47 -
/** #var MapperInterface */
private $mapper;
public function __construct(FFProbeDriver $ffprobe, Cache $cache)
{
$this->ffprobe = $ffprobe;
$this->optionsTester = new OptionsTester($ffprobe, $cache);
at ErrorHandler ->handleError ('4096', 'Argument 1 passed to FFMpeg\FFProbe::__construct() must be an instance of FFMpeg\Driver\FFProbeDriver, array given, called in D:\wamp\www\test-sf3\TestSonata\var\cache\dev\appDevDebugProjectContainer.php on line 10246 and defined', 'D:\wamp\www\test-sf3\TestSonata\vendor\php-ffmpeg\php-ffmpeg\src\FFMpeg\FFProbe.php', '47', array())
in vendor\php-ffmpeg\php-ffmpeg\src\FFMpeg\FFProbe.php at line 47 +
at FFProbe ->__construct (array('ffmpeg.binaries' => 'D:/wamp/bin/ffmpeg/bin/ffmpeg.exe', 'ffprobe.binaries' => 'D:/wamp/bin/ffmpeg/bin/ffprobe.exe'), object(Logger))
in var\cache\dev\appDevDebugProjectContainer.php at line 10246 +
at appDevDebugProjectContainer ->getXmonFfmpeg_FfprobeService (false)
in var\cache\dev\appDevDebugProjectContainer.php at line 10237 +
at appDevDebugProjectContainer ->{closure} (null, object(FFMpegFFProbe_0000000055a8e24d00000000163507555ab0ef05b0b9e546824f0bb3e27d88c9), 'streams', array('pathfile' => 'D:\wamp\tmp\phpA9E3.tmp'), object(Closure))
in var\cache\dev\appDevDebugProjectContainer.php at line 13430 +
at Closure ->__invoke (null, object(FFMpegFFProbe_0000000055a8e24d00000000163507555ab0ef05b0b9e546824f0bb3e27d88c9), 'streams', array('pathfile' => 'D:\wamp\tmp\phpA9E3.tmp'), object(Closure))
in var\cache\dev\appDevDebugProjectContainer.php at line 13430 +
at FFMpegFFProbe_0000000055a8e24d00000000163507555ab0ef05b0b9e546824f0bb3e27d88c9 ->streams ('D:\wamp\tmp\phpA9E3.tmp')
in vendor\xmon\sonata-media-provider-video-bundle\Xmon\SonataMediaProviderVideoBundle\Provider\VideoProvider.php at line 142 +
at VideoProvider ->doTransform (object(Media))
in var\cache\dev\classes.php at line 17962 +
at BaseProvider ->transform (object(Media))
in vendor\sonata-project\media-bundle\Form\DataTransformer\ProviderDataTransformer.php at line 97 +
at ProviderDataTransformer ->reverseTransform (object(Media))
in vendor\symfony\symfony\src\Symfony\Component\Form\Form.php at line 1057 +
at Form ->normToModel (object(Media))
in vendor\symfony\symfony\src\Symfony\Component\Form\Form.php at line 633 +
at Form ->submit (array('providerName' => 'sonata.media.provider.video', 'thumbnailCapture' => '5', 'category' => '1', '_token' => 'CIunMwS122qjpqflpF4LSQH21TTztAPc0yeSHKtyuwE', 'binaryContent' => object(UploadedFile)), true)
in vendor\symfony\symfony\src\Symfony\Component\Form\Extension\HttpFoundation\HttpFoundationRequestHandler.php at line 113 +
at HttpFoundationRequestHandler ->handleRequest (object(Form), object(Request))
in vendor\symfony\symfony\src\Symfony\Component\Form\Form.php at line 488 +
at Form ->handleRequest (object(Request))
in vendor\sonata-project\admin-bundle\Controller\CRUDController.php at line 504 +
at CRUDController ->createAction ()
in vendor\sonata-project\media-bundle\Controller\MediaAdminController.php at line 39 +
at MediaAdminController ->createAction (object(Request))
at call_user_func_array (array(object(MediaAdminController), 'createAction'), array(object(Request)))
in vendor\symfony\symfony\src\Symfony\Component\HttpKernel\HttpKernel.php at line 153 +
at HttpKernel ->handleRaw (object(Request), '1')
in vendor\symfony\symfony\src\Symfony\Component\HttpKernel\HttpKernel.php at line 68 +
at HttpKernel ->handle (object(Request), '1', true)
in vendor\symfony\symfony\src\Symfony\Component\HttpKernel\Kernel.php at line 169 +
at Kernel ->handle (object(Request))
in web\app_dev.php at line 30 +
Solution found :
1 - I change the services in providers.yml to delete xmon_ffmpeg.ffmpeg et xmon_ffmpeg.ffprobe services. My service for the video provider is like this :
services:
sonata.media.provider.video:
class: %xmon_video.provider.video.class%
tags:
- { name: sonata.media.provider }
arguments:
- sonata.media.provider.video
- '#sonata.media.filesystem.local'
- '#sonata.media.cdn.server'
- '#sonata.media.generator.default'
- '#sonata.media.thumbnail.format'
- [ mp4 ]
- [ video/mp4 ]
- '#sonata.media.resizer.custom'
- '#sonata.media.metadata.proxy'
- '#service_container'
- '#doctrine.orm.entity_manager'
calls:
- [ setTemplates, [ { helper_thumbnail: XmonSonataMediaProviderVideoBundle:Provider:thumbnail.html.twig, helper_view: XmonSonataMediaProviderVideoBundle:Provider:video.html.twig } ] ]
2 - and i rewrite the constructor of VideoProvider.php like this :
public function __construct($name, Filesystem $filesystem, CDNInterface $cdn, GeneratorInterface $pathGenerator, ThumbnailInterface $thumbnail, array $allowedExtensions = array(), array $allowedMimeTypes = array(), ResizerInterface $resizer, MetadataBuilderInterface $metadata = null, Container $container, EntityManager $entityManager) {
...
$this->container = $container;
$this->ffmpeg = FFMpeg::create([
'ffmpeg.binaries' => $this->container->getParameter('xmon_ffmpeg.binary'),
'ffprobe.binaries' => $this->container->getParameter('xmon_ffprobe.binary'),
'timeout' => $this->container->getParameter('xmon_ffmpeg.binary_timeout'),
'ffmpeg.threads' => $this->container->getParameter('xmon_ffmpeg.threads_count')
]);
$this->ffprobe = FFProbe::create([
'ffmpeg.binaries' => $this->container->getParameter('xmon_ffmpeg.binary'),
'ffprobe.binaries' => $this->container->getParameter('xmon_ffprobe.binary')
]);
...
}
I am using Yii framework, I am trying to add something to my database and I get this error:
CException
Property "CGridView.data" is not defined.
C:\wamp\www\testdrive - 18-05-2015\yii\framework\web\CWidgetFactory.php(161)
149 if(isset($this->widgets[$className]))
150 $properties=$properties===array() ? $this->widgets[$className] : CMap::mergeArray($this->widgets[$className],$properties);
151 if($this->enableSkin)
152 {
153 if($this->skinnableWidgets===null || in_array($className,$this->skinnableWidgets))
154 {
155 $skinName=isset($properties['skin']) ? $properties['skin'] : 'default';
156 if($skinName!==false && ($skin=$this->getSkin($className,$skinName))!==array())
157 $properties=$properties===array() ? $skin : CMap::mergeArray($skin,$properties);
158 }
159 }
160 foreach($properties as $name=>$value)
161 $widget->$name=$value;
162 return $widget;
163 }
164
165 /**
166 * Returns the skin for the specified widget class and skin name.
167 * #param string $className the widget class name
168 * #param string $skinName the widget skin name
169 * #return array the skin (name=>value) for the widget
170 */
171 protected function getSkin($className,$skinName)
172 {
173 if(!isset($this->_skins[$className][$skinName]))
Stack Trace
#0
+ C:\wamp\www\testdrive - 18-05-2015\yii\framework\web\CWidgetFactory.php(161): CComponent->__set("data", Document)
#1
+ C:\wamp\www\testdrive - 18-05-2015\yii\framework\web\CBaseController.php(146): CWidgetFactory->createWidget(DocumentController, "zii.widgets.grid.CGridView", array("data" => Document, "attributes" => array("id", "file_id", "timestamp", "description", ...)))
#2
+ C:\wamp\www\testdrive - 18-05-2015\yii\framework\web\CBaseController.php(180): CBaseController->createWidget("zii.widgets.grid.CGridView", array("data" => Document, "attributes" => array("id", "file_id", "timestamp", "description", ...)))
#3
– C:\wamp\www\testdrive - 18-05-2015\private\protected\views\document\view.php(30): CBaseController->widget("zii.widgets.grid.CGridView", array("data" => Document, "attributes" => array("id", "file_id", "timestamp", "description", ...)))
25 'file_id',
26 'timestamp',
27 'description',
28 'content',
29 ),
30 )); ?>
#4
+ C:\wamp\www\testdrive - 18-05-2015\yii\framework\web\CBaseController.php(126): require("C:\wamp\www\testdrive - 18-05-2015\private\protected\views\docum...")
#5
+ C:\wamp\www\testdrive - 18-05-2015\yii\framework\web\CBaseController.php(95): CBaseController->renderInternal("C:\wamp\www\testdrive - 18-05-2015\private\protected\views\docum...", array("model" => Document), true)
#6
+ C:\wamp\www\testdrive - 18-05-2015\yii\framework\web\CController.php(869): CBaseController->renderFile("C:\wamp\www\testdrive - 18-05-2015\private\protected\views\docum...", array("model" => Document), true)
#7
+ C:\wamp\www\testdrive - 18-05-2015\yii\framework\web\CController.php(782): CController->renderPartial("view", array("model" => Document), true)
#8
– C:\wamp\www\testdrive - 18-05-2015\private\protected\controllers\DocumentController.php(56): CController->render("view", array("model" => Document))
51 */
52 public function actionView($id)
53 {
54 $this->render('view',array(
55 'model'=>$this->loadModel($id),
56 ));
57 }
58
59 /**
60 * Creates a new model.
61 * If creation is successful, the browser will be redirected to the 'view' page.
#9
unknown(0): DocumentController->actionView("13")
#10
+ C:\wamp\www\testdrive - 18-05-2015\yii\framework\web\actions\CAction.php(109): ReflectionMethod->invokeArgs(DocumentController, array("13"))
#11
+ C:\wamp\www\testdrive - 18-05-2015\yii\framework\web\actions\CInlineAction.php(47): CAction->runWithParamsInternal(DocumentController, ReflectionMethod, array("id" => "13"))
#12
+ C:\wamp\www\testdrive - 18-05-2015\yii\framework\web\CController.php(308): CInlineAction->runWithParams(array("id" => "13"))
#13
+ C:\wamp\www\testdrive - 18-05-2015\yii\framework\web\filters\CFilterChain.php(133): CController->runAction(CInlineAction)
#14
+ C:\wamp\www\testdrive - 18-05-2015\yii\framework\web\filters\CFilter.php(40): CFilterChain->run()
#15
+ C:\wamp\www\testdrive - 18-05-2015\yii\framework\web\CController.php(1145): CFilter->filter(CFilterChain)
#16
+ C:\wamp\www\testdrive - 18-05-2015\yii\framework\web\filters\CInlineFilter.php(58): CController->filterAccessControl(CFilterChain)
#17
+ C:\wamp\www\testdrive - 18-05-2015\yii\framework\web\filters\CFilterChain.php(130): CInlineFilter->filter(CFilterChain)
#18
+ C:\wamp\www\testdrive - 18-05-2015\yii\framework\web\CController.php(291): CFilterChain->run()
#19
+ C:\wamp\www\testdrive - 18-05-2015\yii\framework\web\CController.php(265): CController->runActionWithFilters(CInlineAction, array("accessControl", "postOnly + delete"))
#20
+ C:\wamp\www\testdrive - 18-05-2015\yii\framework\web\CWebApplication.php(282): CController->run("view")
#21
+ C:\wamp\www\testdrive - 18-05-2015\yii\framework\web\CWebApplication.php(141): CWebApplication->runController("document/view")
#22
+ C:\wamp\www\testdrive - 18-05-2015\yii\framework\base\CApplication.php(184): CWebApplication->processRequest()
#23
– C:\wamp\www\testdrive - 18-05-2015\public\index.php(18): CApplication->run()
13 defined('YII_DEBUG') or define('YII_DEBUG',true);
14 // specify how many levels of call stack should be shown in each log message
15 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
16
17 require_once($yii);
18 Yii::createWebApplication($config)->run();
19 ?>
I am not sure what goes wrong exactly. I have 4 other tables in my database and this is the only one that it wont work and it gives an error.
Can you maybe explain to me what goes wrong?? is the problem from my database??
Later on it adds the record to the database even if it give an error before.
CGridView displays a list of data items in terms of a table.
Exception because CGidView not have property 'data'. Class have property 'dataProvider'. Here is an easy example of CGridView. You can use GII for generation examples from your models.
// in your view.
$this->widget('zii.widgets.grid.CGridView', array(
'id' => 'document',
// you can't use key 'data' here
'dataProvider' => $document->search(), // #var Document $document - your model
'columns' => array(
'id',
// ... other properties
)
));
// in model Document
public function search()
{
$criteria = new CDbCriteria();
$criteria->compare('id',$this->id);
//$criteria->compare('one_more_poperty', $this->one_more_poperty);
...
return new CActiveDataProvider($this, array(
'criteria'=>$criteria,
));
}
Everything was working fine. No errors. I change debug to 0, and all of the sudden my pages are giving 404 errors, and in my logs I'm noticing that variables I declared in my app controller (that were working perfectly before) are now coming back as not defined.
Weirdness. Why would changing debug to 0 cause this kind of behaviour?
Edit: Apr 18, 2012
I poked around the Pages controller. After the "$path = func_get_args();" when I threw in a die(print_r($path)). With debug 1 or 2 it returns this on my home page:
Array
(
[0] => home
)
It's blank when debug is set to 0.
Here's some of my routing:
Router::connect('/', array('controller' => 'pages', 'action' => 'display', 'home'));
Router::connect('/login', array('controller' => 'users', 'action' => 'login'));
Router::connect('/logout', array('controller' => 'users', 'action' => 'logout'));
Router::connect('/today', array('controller' => 'users', 'action' => 'today'));
Router::connect('/profile', array('controller' => 'users', 'action' => 'profile'));
$staticPages = array(
'about',
'contact'
);
$staticList = implode('|', $staticPages);
Router::connect('/:static', array(
'plugin' => false,
'controller' => 'pages',
'action' => 'display'), array(
'static' => $staticList,
'pass' => array('static')
)
);
From the debug log:
2012-04-17 10:28:08 Notice: Notice (8): Undefined variable: loggedIn in [/Users/conrad/Desktop/Creative/DEV/virtutrain/app/View/Elements/Header.ctp, line 3]
Trace:
include - APP/View/Elements/Header.ctp, line 3
View::_evaluate() - CORE/Cake/View/View.php, line 908
View::_render() - CORE/Cake/View/View.php, line 872
View::element() - CORE/Cake/View/View.php, line 412
include - APP/View/Layouts/default.ctp, line 22
View::_evaluate() - CORE/Cake/View/View.php, line 908
View::_render() - CORE/Cake/View/View.php, line 872
View::renderLayout() - CORE/Cake/View/View.php, line 527
View::render() - CORE/Cake/View/View.php, line 471
Controller::render() - CORE/Cake/Controller/Controller.php, line 959
ExceptionRenderer::_outputMessage() - CORE/Cake/Error/ExceptionRenderer.php, line 263
ExceptionRenderer::error400() - CORE/Cake/Error/ExceptionRenderer.php, line 209
ExceptionRenderer::render() - CORE/Cake/Error/ExceptionRenderer.php, line 165
ErrorHandler::handleException() - CORE/Cake/Error/ErrorHandler.php, line 127
[main] - [internal], line ??
Error log:
2012-04-17 10:28:08 Error: [NotFoundException] Not Found
#0 /Users/conrad/Desktop/Creative/DEV/virtutrain/lib/Cake/View/View.php(908): include()
#1 /Users/conrad/Desktop/Creative/DEV/virtutrain/lib/Cake/View/View.php(872): View->_evaluate('/Users/conrad/D...', Array)
#2 /Users/conrad/Desktop/Creative/DEV/virtutrain/lib/Cake/View/View.php(463): View->_render('/Users/conrad/D...')
#3 /Users/conrad/Desktop/Creative/DEV/virtutrain/lib/Cake/Controller/Controller.php(959): View->render('about', NULL)
#4 /Users/conrad/Desktop/Creative/DEV/virtutrain/app/Controller/PagesController.php(88): Controller->render('about')
#5 [internal function]: PagesController->display('about')
#6 /Users/conrad/Desktop/Creative/DEV/virtutrain/lib/Cake/Controller/Controller.php(485): ReflectionMethod->invokeArgs(Object(PagesController), Array)
#7 /Users/conrad/Desktop/Creative/DEV/virtutrain/lib/Cake/Routing/Dispatcher.php(103): Controller->invokeAction(Object(CakeRequest))
#8 /Users/conrad/Desktop/Creative/DEV/virtutrain/lib/Cake/Routing/Dispatcher.php(85): Dispatcher->_invoke(Object(PagesController), Object(CakeRequest), Object(CakeResponse))
#9 /Users/conrad/Desktop/Creative/DEV/virtutrain/app/webroot/index.php(96): Dispatcher->dispatch(Object(CakeRequest), Object(CakeResponse))
#10 {main}
Again... not getting any errors whatsoever when debug is at 1 or 2...
This installation is being run locally on MAMP, but the errors also occur on the published site which is running on MediaTemple's grid service (with more or less default settings).
Wow... this was sitting in my home.ctp Page view, and got copied to all other pages:
if (Configure::read('debug') == 0):
throw new NotFoundException();
endif;
Major wtf, but regardless... problem solved.
In Symfony2 I'm trying to implement FOS\OAuthServerBundle, but am getting a weird error. After following the guide here and also the official guide on GitHub, I'm met with an error that says:
Unrecognized field: randomId
500 Internal Server Error - ORMException
This is a protected variable in the Client Entity/Model in FOS\OAuthServerBundle. I must be missing something simple here, but for the life of me I can not figure out what.
Has anyone else experienced a similar error to this?
This error happens when trying to go to:
http://symfony.local/app_dev.php/oauth/v2/token?grant_type=client_credentials&client_id=fd87dddb-6c29-11e4-90f3-b8ca3aa16897_fzhfyllumw0kwwgkocg80wkg8sc4ko0soww0cks4gc0ogggk&client_secret=[secret redacted]
Stack trace
Doctrine\ORM\ORMException: Unrecognized field: randomId
at n/a
in /home/johnny/Development/symfonyProject/vendor/doctrine/orm/lib/Doctrine/ORM/ORMException.php line 100
at Doctrine\ORM\ORMException::unrecognizedField('randomId')
in /home/johnny/Development/symfonyProject/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php line 1681
at Doctrine\ORM\Persisters\BasicEntityPersister->getSelectConditionStatementColumnSQL('randomId', null)
in /home/johnny/Development/symfonyProject/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php line 1610
at Doctrine\ORM\Persisters\BasicEntityPersister->getSelectConditionStatementSQL('randomId', 'fzhfyllumw0kwwgkocg80wkg8sc4ko0soww0cks4gc0ogggk', null)
in /home/johnny/Development/symfonyProject/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php line 1701
at Doctrine\ORM\Persisters\BasicEntityPersister->getSelectConditionSQL(array('id' => 'fd87dddb-6c29-11e4-90f3-b8ca3aa16897', 'randomId' => 'fzhfyllumw0kwwgkocg80wkg8sc4ko0soww0cks4gc0ogggk'), null)
in /home/johnny/Development/symfonyProject/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php line 1115
at Doctrine\ORM\Persisters\BasicEntityPersister->getSelectSQL(array('id' => 'fd87dddb-6c29-11e4-90f3-b8ca3aa16897', 'randomId' => 'fzhfyllumw0kwwgkocg80wkg8sc4ko0soww0cks4gc0ogggk'), null, '0', '1', null, null)
in /home/johnny/Development/symfonyProject/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php line 746
at Doctrine\ORM\Persisters\BasicEntityPersister->load(array('id' => 'fd87dddb-6c29-11e4-90f3-b8ca3aa16897', 'randomId' => 'fzhfyllumw0kwwgkocg80wkg8sc4ko0soww0cks4gc0ogggk'), null, null, array(), '0', '1', null)
in /home/johnny/Development/symfonyProject/vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php line 196
at Doctrine\ORM\EntityRepository->findOneBy(array('id' => 'fd87dddb-6c29-11e4-90f3-b8ca3aa16897', 'randomId' => 'fzhfyllumw0kwwgkocg80wkg8sc4ko0soww0cks4gc0ogggk'))
in /home/johnny/Development/symfonyProject/vendor/friendsofsymfony/oauth-server-bundle/FOS/OAuthServerBundle/Entity/ClientManager.php line 55
at FOS\OAuthServerBundle\Entity\ClientManager->findClientBy(array('id' => 'fd87dddb-6c29-11e4-90f3-b8ca3aa16897', 'randomId' => 'fzhfyllumw0kwwgkocg80wkg8sc4ko0soww0cks4gc0ogggk'))
in /home/johnny/Development/symfonyProject/vendor/friendsofsymfony/oauth-server-bundle/FOS/OAuthServerBundle/Model/ClientManager.php line 41
at FOS\OAuthServerBundle\Model\ClientManager->findClientByPublicId('fd87dddb-6c29-11e4-90f3-b8ca3aa16897_fzhfyllumw0kwwgkocg80wkg8sc4ko0soww0cks4gc0ogggk')
in /home/johnny/Development/symfonyProject/vendor/friendsofsymfony/oauth-server-bundle/FOS/OAuthServerBundle/Storage/OAuthStorage.php line 102
at FOS\OAuthServerBundle\Storage\OAuthStorage->getClient('fd87dddb-6c29-11e4-90f3-b8ca3aa16897_fzhfyllumw0kwwgkocg80wkg8sc4ko0soww0cks4gc0ogggk')
in /home/johnny/Development/symfonyProject/vendor/friendsofsymfony/oauth2-php/lib/OAuth2/OAuth2.php line 707
at OAuth2\OAuth2->grantAccessToken(object(Request))
in /home/johnny/Development/symfonyProject/vendor/friendsofsymfony/oauth-server-bundle/FOS/OAuthServerBundle/Controller/TokenController.php line 40
at FOS\OAuthServerBundle\Controller\TokenController->tokenAction(object(Request))
in line
at call_user_func_array(array(object(TokenController), 'tokenAction'), array(object(Request)))
in /home/johnny/Development/symfonyProject/app/bootstrap.php.cache line 2976
at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), '1')
in /home/johnny/Development/symfonyProject/app/bootstrap.php.cache line 2938
at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), '1', true)
in /home/johnny/Development/symfonyProject/app/bootstrap.php.cache line 3087
at Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel->handle(object(Request), '1', true)
in /home/johnny/Development/symfonyProject/app/bootstrap.php.cache line 2337
at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
in /home/johnny/Development/symfonyProject/web/app_dev.php line 18
Try the tip at the end of this section:
https://github.com/FriendsOfSymfony/FOSOAuthServerBundle/blob/master/Resources/doc/index.md#doctrine-orm-classes
It seems someone had the same problem and solved it, just read the comments below the article which is:
"If you don't have auto_mapping activated in your doctrine configuration you need to add FOSOAuthServerBundle to your mappings in config.yml."
When am adding an extension (EfontAwesome, ref: www.yiiframework.com/extension/efontawesome) to Yii I am getting "chmod(): operation not permitted"
The Call Stack looked something like this..
/opt/lampp/htdocs/yii-1.1.13/framework/utils/CFileHelper.php(133)
121 while(($file=readdir($folder))!==false)
122 {
123 if($file==='.' || $file==='..')
124 continue;
125 $path=$src.DIRECTORY_SEPARATOR.$file;
126 $isFile=is_file($path);
127 if(self::validatePath($base,$file,$isFile,$fileTypes,$exclude))
128 {
129 if($isFile)
130 {
131 copy($path,$dst.DIRECTORY_SEPARATOR.$file);
132 if(isset($options['newFileMode']))
133 chmod($dst.DIRECTORY_SEPARATOR.$file,$options['newFileMode']);
134 }
135 elseif($level)
136 self::copyDirectoryRecursive($path,$dst.DIRECTORY_SEPARATOR.$file,$base.'/'.$file,$fileTypes,$exclude,$level-1,$options);
137 }
138 }
139 closedir($folder);
140 }
141
142 /**
143 * Returns the files found under the specified directory and subdirectories.
144 * This method is mainly used by {#link findFiles}.
145 * #param string $dir the source directory
Stack Trace
#0
+ /opt/lampp/htdocs/yii-1.1.13/framework/utils/CFileHelper.php(133): chmod("/opt/lampp/htdocs/im/assets/6950b6ca/css/font-awesome.css", 438)
#1
+ /opt/lampp/htdocs/yii-1.1.13/framework/utils/CFileHelper.php(136): CFileHelper::copyDirectoryRecursive("/opt/lampp/htdocs/im/protected/extensions/EFontAwesome/assets/cs...", "/opt/lampp/htdocs/im/assets/6950b6ca/css", "/css", array(), ...)
#2
+ /opt/lampp/htdocs/yii-1.1.13/framework/utils/CFileHelper.php(63): CFileHelper::copyDirectoryRecursive("/opt/lampp/htdocs/im/protected/extensions/EFontAwesome/assets", "/opt/lampp/htdocs/im/assets/6950b6ca", "", array(), ...)
#3
+ /opt/lampp/htdocs/yii-1.1.13/framework/web/CAssetManager.php(251): CFileHelper::copyDirectory("/opt/lampp/htdocs/im/protected/extensions/EFontAwesome/assets", "/opt/lampp/htdocs/im/assets/6950b6ca", array("exclude" => array(".svn", ".gitignore"), "level" => -1, "newDirMode" => 511, "newFileMode" => 438))
#4
– /opt/lampp/htdocs/im/protected/extensions/EFontAwesome/components/EFontAwesome.php(41): CAssetManager->publish("/opt/lampp/htdocs/im/protected/extensions/EFontAwesome/assets", false, -1, true)
36 public function getAssetsUrl() {
37 if (isset($this->_assetsUrl))
38 return $this->_assetsUrl;
39 else {
40 $assetsPath = Yii::getPathOfAlias('efontawesome.assets');
41 $assetsUrl = Yii::app()->assetManager->publish($assetsPath, false, -1, YII_DEBUG);
42 return $this->_assetsUrl = $assetsUrl;
43 }
44 }
45 }
This is only happening in debug mode and not in production mode.
The directory is writable by the web process (as it can be seen to work in production mode) and this extension was working perfectly well in debug mode few days back,
A brief google search only bought up the this closed issue on github :https://github.com/yiisoft/yii/issues/1853 regarding forcedCopy and linkAssets config conflict, which was fixed in Yii-1.1.13(the version I am using), just to be safe I had also tried setting the config of both to false in the main config files like this
'assetManager' => array(
'linkAssets' => false,
'forceCopy'=>false,
),
but the issue is persisting, any ideas on how to solve this?