Simplesamlphp_auth module in Drupal 8 + Simplesaml library - drupal-8

I have successfully installed simplesamlphp and configured my system as SP. And also able to login to IDP. Now I want to integrate it in my drupal8 project.
So as per the installation instructions, I downloaded simplesamlphp_auth module in my drupal project module folder and refreshed admin panel to install it, throws an error like this-
The website encountered an unexpected error. Please try again later.</br></br><em class="placeholder">SimpleSAML\Error\CriticalConfigurationError</em>: The configuration (config/config.php) is invalid: Missing configuration file in <em class="placeholder">SimpleSAML\Error\CriticalConfigurationError::fromException()</em> (line <em class="placeholder">78</em> of <em class="placeholder">vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/CriticalConfigurationError.php</em>). <pre class="backtrace">SimpleSAML_Configuration::getInstance() (Line: 43)
SimpleSAML\Auth\Simple->__construct('default-sp') (Line: 59)
Drupal\simplesamlphp_auth\Service\SimplesamlphpAuthManager->__construct(Object) (Line: 262)
Drupal\Component\DependencyInjection\Container->createService(Array, 'simplesamlphp_auth.manager') (Line: 171)
Drupal\Component\DependencyInjection\Container->get('simplesamlphp_auth.manager', 1) (Line: 480)
Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array) (Line: 230)
Drupal\Component\DependencyInjection\Container->createService(Array, 'simplesamlphp_auth_event_subscriber') (Line: 171)
Drupal\Component\DependencyInjection\Container->get('simplesamlphp_auth_event_subscriber') (Line: 105)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.request', Object) (Line: 127)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 664)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Please help me with this issue.

After spending whole day on this issue, I finally resolved this error by copying docroot/simplesamlphp/config and metadata folder in vendor/simplesamlphp/config and metadata.
Thanks.

Related

scandir(/var/app/current/protected/modules): Failed to open directory: No such file or directory

I have tried to host humhub which is an yii2 open source social media on aws elastic beanstalk but when I open the site I get an error exception
Can anyone tell me how to fix it please?
This is the error
PHP Warning – yii\base\ErrorException
scandir(/var/app/current/protected/modules): Failed to open directory: No such file or directory
in /var/app/current/protected/humhub/components/bootstrap/ModuleAutoLoader.php at line 50
yii\base\ErrorHandler::handleError(2, 'scandir(/var/app/current/protect...', '/var/app/current/protected/humhu...', 50)
in /var/app/current/protected/humhub/components/bootstrap/ModuleAutoLoader.php at line 50 – scandir('/var/app/current/protected/modul...')
in /var/app/current/protected/humhub/components/bootstrap/ModuleAutoLoader.php at line 32 – humhub\components\bootstrap\ModuleAutoLoader::locateModules()
in /var/app/current/protected/vendor/yiisoft/yii2/base/Application.php at line 327 – humhub\components\bootstrap\ModuleAutoLoader::bootstrap(humhub\components\Application)
in /var/app/current/protected/vendor/yiisoft/yii2/web/Application.php at line 69 – yii\base\Application::bootstrap()
in /var/app/current/protected/humhub/components/Application.php at line 46 – yii\web\Application::bootstrap()
in /var/app/current/protected/vendor/yiisoft/yii2/base/Application.php at line 273 – humhub\components\Application::bootstrap()
in /var/app/current/protected/vendor/yiisoft/yii2/base/BaseObject.php at line 109 – yii\base\Application::init()
in /var/app/current/protected/vendor/yiisoft/yii2/base/Application.php at line 206 – yii\base\BaseObject::__construct(['name' => 'HumHub', 'version' => '1.5.1', 'bootstrap' => ['log', 'humhub\components\bootstrap\Modu...', 'queue', 'humhub\modules\ui\view\bootstrap...', ...], 'sourceLanguage' => 'en', ...])
in /var/app/current/index.php at line 25 – yii\base\Application::__construct(['name' => 'HumHub', 'version' => '1.5.1', 'bootstrap' => ['log', 'humhub\components\bootstrap\Modu...', 'queue', 'humhub\modules\ui\view\bootstrap...', ...], 'sourceLanguage' => 'en', ...])

I have a problem running Foundation Watch (gulp error) - /_input-group.scss

The compile fails because of the error:
Error in plugin "sass"
Message:
node_modules\foundation-sites\scss\forms\_input-group.scss
Error: Incompatible units: 'rem' and 'rem*rem'.
on line 25 of node_modules/foundation-sites/scss/forms/_input-group.scss, in mixin `foundation-form-prepostfix`
from line 30 of node_modules/foundation-sites/scss/forms/_forms.scss, in mixin `foundation-forms`
from line 14 of scss/app.scss
> $height: ($input-font-size * $input-line-height) + (get-side($input-paddin
-----------^
I use the input-group features in login and sign forms and can't afford to not include the foundation-forms; in my app.scss file. This problem arised when i switched from win 7 to win 10.
Thanks for the answers but I have already found the solution. I updated the _input-group.scss file. See below.
From
$height: ($input-font-size * $input-line-height) + (get-side($input-padding, 'top') + get-side($input-padding, 'bottom')) - rem-calc(1);
to
$height: ($input-font-size + $form-spacing * 1.5);
Best regards,
Jure

Failed to Create preset with Amazon Elastic Transcoder

I am using Amazon Elastic transcoder and boto library to create a preset.
This code works for me without any problem:
preset1=transcode.create_preset('preset', 'preset', 'mp4', {"Codec":"H.264", "CodecOptions":{"Profile":"baseline", "Level":"3",
"MaxReferenceFrames":"3"}, "KeyframesMaxDist":"200", "FixedGOP":"false", "BitRate":"600", "FrameRate":"10", "Resolution":"640x480",
"AspectRatio":"4:3" }, {"Codec":"AAC","CodecOptions":{"Profile":"AAC-LC"}, "SampleRate":"22050", "BitRate":"32", "Channels":"1" },
{"Format":"png", "Interval":"60", "Resolution":"192x144", "AspectRatio":"4:3"})
But, when I define a var with same value :
preset_h264_480p_100kbs_mp4_command='"Name":"preset","Description": "preset", "Container":"mp4","video":
{"Codec":"H.264", "CodecOptions":{"Profile":"baseline", "Level":"3", "MaxReferenceFrames":"3"}, "KeyframesMaxDist":"200",
"FixedGOP":"false", "BitRate":"600", "FrameRate":"10", "Resolution":"640x480", "AspectRatio":"4:3" },"audio":
{"Codec":"AAC","CodecOptions":{"Profile":"AAC-LC"}, "SampleRate":"22050", "BitRate":"32", "Channels":"1" }, "thumbnails":
{"Format":"png", "Interval":"60", "Resolution":"192x144", "AspectRatio":"4:3"}'
I get into this error :
transcode.create_preset(preset_h264_480p_100kbs_mp4_command)Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/boto/elastictranscoder/layer1.py", line 421, in create_preset
data=json.dumps(params))
File "/usr/local/lib/python2.7/dist-packages/boto/elastictranscoder/layer1.py", line 932, in make_request
raise error_class(response.status, response.reason, body)
boto.elastictranscoder.exceptions.ValidationException: ValidationException: 400 Bad Request
{u'message': u'2 validation errors detected: Value null at \'container\' failed to satisfy constraint: Member must not be null; Value \'"Name":"preset","Description": "preset", "Container":"mp4","video": {"Codec":"H.264", "CodecOptions":{"Profile":"baseline", "Level":"3", "MaxReferenceFrames":"3"}, "KeyframesMaxDist":"200", "FixedGOP":"false", "BitRate":"600", "FrameRate":"10", "Resolution":"640x480", "AspectRatio":"4:3" },"audio": {"Codec":"AAC","CodecOptions":{"Profile":"AAC-LC"}, "SampleRate":"22050", "BitRate":"32", "Channels":"1" }, "thumbnails":{"Format":"png", "Interval":"60", "Resolution":"192x144", "AspectRatio":"4:3"}\' at \'name\' failed to satisfy constraint: Member must have length less than or equal to 40'}
This validation is telling that the 'container' is null! But it is not null.
I am confused what is happening !
Thanks in advance
You can write this using unpacking arg list feature in Python:
preset_h264_480p_100kbs_mp4_command={ "name":"preset","description": "preset", "container":"mp4","video":
{"Codec":"H.264", "CodecOptions":{"Profile":"baseline", "Level":"3", "MaxReferenceFrames":"3"}, "KeyframesMaxDist":"200",
"FixedGOP":"false", "BitRate":"600", "FrameRate":"10", "Resolution":"640x480", "AspectRatio":"4:3" },"audio":
{"Codec":"AAC","CodecOptions":{"Profile":"AAC-LC"}, "SampleRate":"22050", "BitRate":"32", "Channels":"1" }, "thumbnails":
{"Format":"png", "Interval":"60", "Resolution":"192x144", "AspectRatio":"4:3"} }
transcode.create_preset(**preset_h264_480p_100kbs_mp4_command)

Cocos2D V3.0 crash CCLabelTTF

I am converting my project from using Cocos2D v2.1 to V3.0. It's a UIKit project with Cocos2D added as a sub-project and the director loaded lazily in a couple of viewcontrollers.
I managed to get rid of all the compiler warnings, it runs fine and seems to load the director fine, but then crashes as follows:
-[NSConcreteMutableAttributedString hasAttribute:]: unrecognized selector sent to instance 0xc4f8ff0
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSConcreteMutableAttributedString hasAttribute:]: unrecognized selector sent to instance 0xc4f8ff0'
*** First throw call stack:
(
0 CoreFoundation 0x0291a1e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x026998e5 objc_exception_throw + 44
2 CoreFoundation 0x029b7243 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
3 CoreFoundation 0x0290a50b ___forwarding___ + 1019
4 CoreFoundation 0x0290a0ee _CF_forwarding_prep_0 + 14
5 0x0019d7d0 -[CCLabelTTF updateTexture] + 544
6 0x0019d546 -[CCLabelTTF visit] + 70
7 0x00181c86 -[CCNode visit] + 566
8 0x00181c86 -[CCNode visit] + 566
9 0x00202b9d -[CCDirectorIOS drawScene] + 381
10 0x00203fdc -[CCDirectorDisplayLink mainLoop:] + 92
The breakpoint stops in the CCLabelTTF function - (BOOL) updateTexture at
#ifdef __CC_PLATFORM_IOS
// Font color
if (![formattedAttributedString hasAttribute:NSForegroundColorAttributeName])
There is only one CCLabelTTF in the code, and I create it like so:
self.scoreLabel = [CCLabelTTF labelWithString:NSLocalizedString(#"Score", #"") fontName:#"Marker Felt" fontSize:20 dimensions:CGSizeMake(100, 50)];
self.scoreLabel.horizontalAlignment = (CCTextAlignment)NSTextAlignmentRight;
scoreLabel.position = ccp(250,70);
[self addChild:scoreLabel z:1];
Any help much appreciated. I've searched Cocos2D forums and here and can't find anything similar to this issue.
Ahh... just solved it. Since Cocos2d is a sub-project, I had to include the -ObjC flag under Other Linker Flags for the target. This wasn't necessary with v2.1, but then that version didn't use the NSAttributedString+CCAdditions category.

python imaplib - error 'unexpected repsonse'

Hi I've suddenly encountered an error using imaplib on some code that worked fine before.
import imaplib
m = imaplib.IMAP4('myserver','port')
m.login(r'username','password')
m.select()
gives me the error
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/imaplib.py", line 649, in select
typ, dat = self._simple_command(name, mailbox)
File "/usr/lib/python2.7/imaplib.py", line 1070, in _simple_command
return self._command_complete(name, self._command(name, *args))
File "/usr/lib/python2.7/imaplib.py", line 899, in _command_complete
raise self.abort('command: %s => %s' % (name, val))
imaplib.abort: command: SELECT => unexpected response: '* 1520 EXISTS'
I'm not sure what it means. Emails are otherwise coming through fine, and I'm using davmail as a server.
The program in its entirety saves attachments with a certain name in a specific folder.
I've stepped through it and its definitely the m.select() that is where its falling over.
This same program worked absolutely fine until recently.
What am I doing wrong, and how do I fix it?
The log of activity is as follows
>>> import imaplib
>>> m = imaplib.IMAP4('server','port')
>>> Debug=4
>>> m.debug
0
>>> m.debug=4
>>> m.debug
4
>>> m.login(r'username','password')
01:26.55 > HLFI1 LOGIN "username" "password"
01:30.76 < HLFI1 OK Authenticated
('OK', ['Authenticated'])
>>> m.list()
01:56.33 > HLFI2 LIST "" *
02:00.04 < * LIST (\HasNoChildren) "/" "Trash/Sent Messages"
02:00.04 < * LIST (\HasNoChildren) "/" "Sync Issues/Server Failures"
02:00.04 < * LIST (\HasNoChildren) "/" "Sync Issues/Local Failures"
02:00.04 < * LIST (\HasNoChildren) "/" "Sync Issues/Conflicts"
02:00.04 < * LIST (\HasChildren) "/" "Sync Issues"
02:00.04 < * LIST (\HasNoChildren) "/" "Junk E-mail"
02:00.04 < * LIST (\HasNoChildren) "/" "Drafts"
02:00.04 < * LIST (\HasChildren) "/" "Trash"
02:00.04 < * LIST (\HasNoChildren) "/" "Sent"
02:00.04 < * LIST (\HasNoChildren) "/" "Outbox"
02:00.04 < * LIST (\HasNoChildren) "/" "INBOX"
02:00.04 < HLFI2 OK LIST completed
('OK', ['(\\HasNoChildren) "/" "Trash/Sent Messages"', '(\\HasNoChildren) "/" "Sync Issues/Server Failures"', '(\\HasNoChildren) "/" "Sync Issues/Local Failures"', '(\\HasNoChildren) "/" "Sync Issues/Conflicts"', '(\\HasChildren) "/" "Sync Issues"', '(\\HasNoChildren) "/" "Junk E-mail"', '(\\HasNoChildren) "/" "Drafts"', '(\\HasChildren) "/" "Trash"', '(\\HasNoChildren) "/" "Sent"', '(\\HasNoChildren) "/" "Outbox"', '(\\HasNoChildren) "/" "INBOX"'])
>>> m.select()
02:21.37 > HLFI3 SELECT INBOX
02:30.87 < * 1548 EXISTS
02:30.87 last 4 IMAP4 interactions:
00:16.73 < * OK [CAPABILITY IMAP4REV1 AUTH=LOGIN MOVE] IMAP4rev1 DavMail 4.3.0-2125 server ready
00:16.73 > HLFI0 CAPABILITY
00:16.74 < * CAPABILITY IMAP4REV1 AUTH=LOGIN MOVE
00:16.77 < HLFI0 OK CAPABILITY completed
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/imaplib.py", line 649, in select
typ, dat = self._simple_command(name, mailbox)
File "/usr/lib/python2.7/imaplib.py", line 1070, in _simple_command
return self._command_complete(name, self._command(name, *args))
File "/usr/lib/python2.7/imaplib.py", line 899, in _command_complete
raise self.abort('command: %s => %s' % (name, val))
imaplib.abort: command: SELECT => unexpected response: '* 1548 EXISTS'
** UPDATE **
I've now filed a bug at python-dev under
Bug report on Python
Where David Murray says the response is non RFC compliant
And a second at davmail sourceforge under
davmail bug report
M guessant says it is necessary for the IMAP keep alive.
I'll keep this updated with developments..
It appears that the space-padded message count in the RECENT response is what triggers this. It is unclear to me whether it should be classified as an error in Python's imaplib or in the IMAP server you are using. I would argue that imaplib should be robust against this, regardless of what the spec says. Perhaps you should file a bug report?
(If you do, please take care to add details about which server is producing this response. If it is a commercial product with a respectable market share, it is important to fix, whereas of course, if it's your own simple Python server, they might not care.)
Found the response of the EXISTS command is padded by davmail, it seems to be when the number of emails is around or over 500.
Acceptable response:
58:24.54 > PJJD3 EXAMINE INBOX
58:24.77 < * 486 EXISTS
58:24.78 matched r'\* (?P<data>\d+) (?P<type>[A-Z-]+)( (?P<data2>.*))?' => ('486', 'EXISTS', None, None)
58:24.78 untagged_responses[EXISTS] 0 += ["486"]
Failed response:
57:50.86 > KPFE3 EXAMINE INBOX
57:51.10 < * 953 EXISTS
57:51.10 last 0 IMAP4 interactions:
57:51.10 > KPFE4 LOGOUT
Have create a pull request for the imaplib library at github to account for the issue
To patch your code the imaplib allows the regex to be altered, simply add the following to your code:
imaplib.Untagged_status = imaplib.re.compile(br'\*[ ]{1,2}(?P<data>\d+) (?P<type>[A-Z-]+)( (?P<data2>.*))?')