latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Error 400

Home Forums Community Forum Error 400

Tagged: , , , , , ,

This topic contains 32 replies, has 6 voices. Last updated by  Cristián Lávaque 4 years, 10 months ago.

Topic Author Topic
Posted: Wednesday Feb 8th, 2012 at 12:22 pm #4478
Bendix
Username: benchefe

Hi,
I am still in trouble with setting up CloudFont.

“Unable to auto-configure Amazon® CloudFront Distributions.
Error code: 400. Error Message: Unable to create Amazon® CloudFront Origin Access Identity. Unable to create Amazon® CloudFront Origin Access Identity. Bad Request”

I tried everything I found in this forum… without success…

The Amazone S3 Bucket name is just the bucket, without http or the amazon domain stuff, right?
mybucket ? or mybucket.s3.amazonaws.com ?
Do I have to set the distributions first?

Sorry… I am new in this amazon s3 stuff….

List Of Topic Replies

Viewing 25 replies - 1 through 25 (of 32 total)
Author Replies
Author Replies
Posted: Tuesday Feb 14th, 2012 at 12:52 am #5005
Bendix
Username: benchefe

Well… amazon S3 is working…. but the auto configuration for the cloud front still fails.
Is there a chance to get more information about error 400 ?

Posted: Tuesday Feb 14th, 2012 at 12:31 pm #5043

You might want to double check that the spelling of your bucket on S3 matches what you have entered in the fields for Cloudfront/S3 config within s2member. I had problems similar to this and realized that my bucket wasn’t named exactly the same as what I entered in the configuration. There was a slight mispelling on my bucket name. Not sure if that helps..

Posted: Wednesday Feb 15th, 2012 at 3:43 am #5206
Bendix
Username: benchefe

thanx for your advice, luisrosario!
but my s3 bucket is working using the advanced mod-rewrite.
just the cloud front auto configuration fails: error 400!

is there anything I have to setup in my amazon configuration to prepare cloud front for connecting with s2member?

maybe I missed something….

Greetings

Posted: Wednesday Feb 15th, 2012 at 8:15 am #5221
Eduan
Username: Eduan
Moderator

Hi Bendix, thanks for your inquiry.

What version of Apache do you have in your server?
And what version of s2Member do you have?

Posted: Wednesday Feb 15th, 2012 at 9:24 am #5223
Bendix
Username: benchefe

Hey Eduán,

thx for your post.

Server version: Apache/2.2.16 (Debian)
Server built: Feb 5 2012 21:35:42

s2Member Version 120213 + s2Member Pro v120213

my php info

greetings

Posted: Thursday Feb 16th, 2012 at 2:51 am #5324

Hi Bendix.

Could you double check that you copied your CloudFront Key Pair ID and Private Key exactly? And did you enable Auto-Configure? [hilite path]WP Admin -> s2Member -> Downloads Options -> Amazon S3/CloudFront[/hilite]

Remember to click the “Save All Changes” button at the bottom after any changes for them to be applied.

Posted: Thursday Feb 16th, 2012 at 3:04 am #5328
Bendix
Username: benchefe

Hi Christiàn,

I already tried 10 times, with different key pairs :(
S3 is working, but setting up cloud front fails.

Auto config is enabled before clicking the save all button.
After clicking, the error 400 appears on top and the “YES, I want s2Member to auto-configure using custom CNAMES that I`ll setup” is enabled as well.
I haven’t enabled this checkbox manually….

The options are savable when unchecking both checkboxes with entered key pair ID and private key.

Is there a way to use the cloud front setup without auto configuration?

Posted: Friday Feb 17th, 2012 at 2:11 am #5459

Got it. Could you check out this thread and see if you find something there that helps you with this? http://www.primothemes.com/forums/viewtopic.php?f=4&t=15853

Also, what version of s2Member are you using?

Posted: Friday Feb 17th, 2012 at 3:10 am #5469

After more investigating I realized that I am getting the html fallback and not the rtmp stream.. I had some wrong code inserted and the player fell back to html and i was still able to play the video. Below is the current output of the code that i copied from the page source, it seems the rtmp url is not generating properly??? .. With this current code, I’m now getting stream not found, any thoughts?:

/* First try real-time streaming with Flash® player. */
{type: “flash”, provider: “rtmp”, src: “/jwplayer/player.swf”,
config: {streamer: “rtmp://s11efhi1yjrfux.cloudfront.net/cfx/st”, file: “wp-content/plugins/s2member-files/s2member-file-storage-cf/access-s2member-level0/arms_11.1.mp4?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoid3AtY29udGVudC9wbHVnaW5zL3MybWVtYmVyLWZpbGVzL3MybWVtYmVyLWZpbGUtc3RvcmFnZS1jZi9hY2Nlc3MtczJtZW1iZXItbGV2ZWwwL2FybXNfMTEuMS5tcDQiLCJDb25kaXRpb24iOnsiSXBBZGRyZXNzIjp7IkFXUzpTb3VyY2VJcCI6Ijc2Ljg5LjE0NS4zLzMyIn0sIkRhdGVMZXNzVGhhbiI6eyJBV1M6RXBvY2hUaW1lIjoxMzI5NTUyMzg1fX19XX0_&Signature=d8BZIESNGSLKGWbx2hiFGB1XzfNJuONZUOZIPOiYZRa~YhqSoKFk2IGuZs85lwqtbLp2y1Z940XyzKzxu1kngc5fBeXOT68THttXY4h6AKQqoylp~izFhd87eVASvRazY-uZXVixRF0U6gxIrhYa-T4NnsrS0JuD-YVqIJhsmLA_&Key-Pair-Id=APKAJ7GIEGYYPENSOKXA”}},

/* Else, try an HTML5 video tag. */
{type: “html5”, provider: “video”,
config: {file: “http://d2682nyny5dncn.cloudfront.net/wp-content/plugins/s2member-files/s2member-file-storage-cf/access-s2member-level0/arms_11.1.mp4?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cDovL2QyNjgybnlueTVkbmNuLmNsb3VkZnJvbnQubmV0L3dwLWNvbnRlbnQvcGx1Z2lucy9zMm1lbWJlci1maWxlcy9zMm1lbWJlci1maWxlLXN0b3JhZ2UtY2YvYWNjZXNzLXMybWVtYmVyLWxldmVsMC9hcm1zXzExLjEubXA0IiwiQ29uZGl0aW9uIjp7IklwQWRkcmVzcyI6eyJBV1M6U291cmNlSXAiOiI3Ni44OS4xNDUuMy8zMiJ9LCJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTMyOTU1MjM4NX19fV19&Signature=U2H3gSfd-~Kft1eLrAZSZENfXWFTMKspUykCulUitSQfqk0Ew6XA-5FjgZSgYJL~x2M7kObKSIxnjpC9EfMe4uife339CnnsAYB1Zp34SjByGGW5kcPWBi4k93rfI-0u-6g0iYcC8NG~NdjVPWqd-BmuSUkH6yKFmOP~0rF9b~8_&Key-Pair-Id=APKAJ7GIEGYYPENSOKXA”}},

/* Else, this is a safe fallback. */
{type: “download”, /* Download the file. */
config: {file: “http://d2682nyny5dncn.cloudfront.net/wp-content/plugins/s2member-files/s2member-file-storage-cf/access-s2member-level0/arms_11.1.mp4?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cDovL2QyNjgybnlueTVkbmNuLmNsb3VkZnJvbnQubmV0L3dwLWNvbnRlbnQvcGx1Z2lucy9zMm1lbWJlci1maWxlcy9zMm1lbWJlci1maWxlLXN0b3JhZ2UtY2YvYWNjZXNzLXMybWVtYmVyLWxldmVsMC9hcm1zXzExLjEubXA0IiwiQ29uZGl0aW9uIjp7IklwQWRkcmVzcyI6eyJBV1M6U291cmNlSXAiOiI3Ni44OS4xNDUuMy8zMiJ9LCJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTMyOTU1MjM4NX19fV19&Signature=U2H3gSfd-~Kft1eLrAZSZENfXWFTMKspUykCulUitSQfqk0Ew6XA-5FjgZSgYJL~x2M7kObKSIxnjpC9EfMe4uife339CnnsAYB1Zp34SjByGGW5kcPWBi4k93rfI-0u-6g0iYcC8NG~NdjVPWqd-BmuSUkH6yKFmOP~0rF9b~8_&Key-Pair-Id=APKAJ7GIEGYYPENSOKXA”}}
],

  • This reply was modified 4 years, 10 months ago by  luisrosario.
Posted: Monday Feb 20th, 2012 at 9:15 am #5686
Bendix
Username: benchefe

Thx for your replys!

I am using just a single site installation. I tried everything I found.
Disabling all plugins and my custom theme :( nothing worked for me!

Is there a chance somebody tries to setup auto-config using another amazon s3 source?
Maybe christian or luisrosario ?
I would sent you admin login. maybe you can test it with your clound front.

On this way we may find out, if this is a problem of my wordpress installation or maybe my amazon s3 cloud front.
or the other way round. I can sent you my amazon s3 data.

what do you think?

Posted: Tuesday Feb 21st, 2012 at 1:50 am #5832

Jason posted a new video where he talks about the Amazon integration. Maybe it helps you find what’s wrong?

[video playlist="BD496E5F2CCAB12A" width="663" height="400" start="0" show_etag="yes" /]
Posted: Tuesday Feb 21st, 2012 at 2:30 am #5833
Bendix
Username: benchefe

Hey Christian,

thx. I was watching the new video yesterday. Congratulations for your great support and these tons of videos you made :) It is amazing that you all can share this great support while developing s2member at the same time.

But for me, this could not solve my problem :(

Looks like a server configuration is wrong or it has to do with being in germany… don’t know…
Could you share or mail your server configuration? I already read Jasons “ideal server config”
but maybe there is something else that causes this problem…

greetings

Posted: Thursday Feb 23rd, 2012 at 3:40 am #6086
Staff Member

Hi there. Thanks for the follow-up.

Could you share or mail your server configuration?

Sorry. I’m not sure what you mean. Can you please elaborate just a bit further?

Posted: Thursday Feb 23rd, 2012 at 3:55 am #6092
Bendix
Username: benchefe

Oh sorry :)
It`s not always that easy for me to translate my thoughts :)

This is my php info file:
http://www.vocalcoaching-online.com/phpinfo.html

maybe you can share your ideal php configuration.

this might be a way for me to find out differences…

Posted: Friday Feb 24th, 2012 at 6:47 pm #6354
Posted: Monday Feb 27th, 2012 at 10:09 pm #6619
Staff Member

Hi Bendix. Yes, this article talks about the ideal server configuration for s2Member.
http://www.s2member.com/forums/topic/ideal-server-configuration-for-s2member/

I took a quick look at your PHP configuration, that looks good. If you continue to have trouble, please post a copy of your .htaccess file also, and/or any other Apache configuration options you’re running.

Posted: Thursday Mar 1st, 2012 at 2:04 pm #6912
Mark R.
Username: marktyt

I’ve read many threads that tries to deal with this 400 error – and tried everything I can think of.

On a clean install, I try to set up CloudFront and also get the following error:

Unable to auto-configure Amazon® CloudFront Distributions.
Error code: 400. Error Message: Unable to create Amazon® CloudFront Origin Access Identity. Unable to create Amazon® CloudFront Origin Access Identity. Bad Request

I’ve triple checked the keys – copied directly without additional spaces. I still get this error.

Jason, since you’ve asked another member, here is my htaccess file:
===================================================
# BEGIN s2Member GZIP exclusions

RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} (^|\?|&)s2member_file_download\=.+
RewriteRule .* – [E=no-gzip:1]

# END s2Member GZIP exclusions

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress
===================================================

Any additional help would be greatly appreciated as we can not use S2 without this working.

Posted: Friday Mar 2nd, 2012 at 2:24 am #7011

Hi Mark.

Have you watched Jason’s videos on Amazon’s integration? Video » s2Member® File Downloads (Amazon S3/CloudFront/JW Player)

Posted: Friday Mar 2nd, 2012 at 12:27 pm #7084
Mark R.
Username: marktyt

I absolutely have watched the videos (great to have) – and followed it exactly. And I get that error – just as others have. On a side note, one thing that it doesn’t mention is that if you haven’t entered in default download limits the video will not be displayed. I figured that one out after a bit, and at least now shows the window. But when you click play, it can’t find the video the download link works – but it’s using the S3 link rather than the CloudFront one.

The steps are rather simple: copy and paste the S3 settings, copy and paste the CloudFront settings, click the checkbox to auto-configure. That’s it. When that fails, it leaves us with a very frustrating “what next” feeling.

  • This reply was modified 4 years, 10 months ago by  Mark R..
Posted: Friday Mar 2nd, 2012 at 4:29 pm #7099

Right, I can understand you’d feel like that.

I’ll mention your observation on default download limits to Jason.

So you followed every instruction and it doesn’t work? Could you please post the code your using for the player?

Posted: Tuesday Mar 6th, 2012 at 10:25 am #7451
Mark R.
Username: marktyt

Sure thing. Here is the code from the player page:

<a href="[s2File download="video.mp4" /]">Download Now</a>

<div id="jw-container">JW Player® appears here.</div>
<script type="text/javascript" src="/jwplayer/jwplayer.js"></script>

<?php
/* A direct URL to the CloudFront RTMP source; counting the file against the current User in real-time. */
$mp4_via_cf_cfg = array ("file_storage" => "cf", "file_download" => "video.mp4", "url_to_storage_source" => true, "count_against_user" => true);

/* A direct URL to the Amazon S3 source; NOT counting this variation against the current User. */
$mp4_via_s3_cfg = array ("file_storage" => "s3", "file_download" => "video.mp4", "url_to_storage_source" => true);

/* API Function `s2member_file_download_url()` returns false if access is denied to the current User. */
if (($mp4_via_cf = s2member_file_download_url ($mp4_via_cf_cfg, "get-streamer-array")) && ($mp4_via_s3["url"] = s2member_file_download_url ($mp4_via_s3_cfg))) {
?>

	<script type="text/javascript">
		jwplayer("jw-container").setup({modes: /* JW Player®. */
		[
			/* First try real-time streaming with Flash® player. */
			{type: "flash", provider: "rtmp", src: "/jwplayer/player.swf",
				config: {streamer: "<?php echo $mp4_via_cf["streamer"]; ?>", file: "<?php echo $mp4_via_cf["file"]; ?>"}},
				
			/* Else, try an HTML5 video tag with the `mp4` file. */
			{type: "html5", provider: "video",
			config: {file: "<?php echo $mp4_via_s3["url"]; ?>"}},
			
			/* Else, this is a safe fallback. */
			{type: "download", /* Download the file. */
				config: {file: "<?php echo $mp4_via_s3["url"]; ?>"}}
		],
		/* Set video dimensions. */ width: 480, height: 270
		});
	</script>

<?php } else /* Access is denied to the current User. */ { ?>
	Sorry, you do NOT have access to this file.
<?php } ?>

Depending on the settings, it will display:

Download Now
JW Player® appears here.
Sorry, you do NOT have access to this file. 

The link works just fine (it references http://www.thenewtyt.com/?s2member_file_download=/video.mp4 – which does download).

The JW javascript can be directly accessed just fine by going to:
http://www.domainname/jwplayer/jwplayer.js

However, the jw-container DIV tag is of course no where references (there is no CSS file that it references). Where is that suppose to come since we manually installed the JW player per your instructions?

When I did finally get the video window to display, when you click START it errors saying the video cannot be found.

Posted: Thursday Mar 8th, 2012 at 4:00 pm #7649
Staff Member

Thanks for the follow-up.

I tested your code sample in our lab and it’s working properly. Have you tried this on a clean installation of WordPress, with no other plugins except s2Member, and using the default theme for WordPress?

Here are some other things that come to mind:

1. Perhaps the code is being mangled by the WordPress editor, or by your theme? Right-click on the page and choose “View Source”. Please post a copy of the resulting HTML produced by the code snippet you posted earlier. This may shed light on the issue.

2. Are you running s2Member v120301 or higher? You’ll need s2Member v120301 or newer for that code sample to work properly. s2Member v120301 introduced a bug fix related to the storage parameter. See: s2Member® Unified Changelog » v120301

Posted: Thursday Mar 8th, 2012 at 4:53 pm #7655
Mark R.
Username: marktyt

Hi Jason!

OK – backed up WP, installed new clean install, but I left the database intact. That might have been a mistake though, as after I installed S2member again as the only plugin using the generic theme, I got the same exact error:

Unable to auto-configure Amazon® CloudFront Distributions.
Error code: 400. Error Message: Unable to create Amazon® CloudFront Origin Access Identity. Unable to create Amazon® CloudFront Origin Access Identity. Bad Request

I can try it again, this time with a new database.

Posted: Thursday Mar 8th, 2012 at 5:03 pm #7657
Mark R.
Username: marktyt

Nope. new install – new database. Same exact issue. I added the S3 bucket no problem – but the CloudFront fails with the same exact error on a new install/new database. Now what?

Also, we’re running the most recent version as this is a brand new install (and we’ve never used the system before).

I’ll supply the admin U/N P/W on the form.

  • This reply was modified 4 years, 10 months ago by  Mark R..
  • This reply was modified 4 years, 10 months ago by  Mark R..
Posted: Friday Mar 9th, 2012 at 5:19 am #7706
Bendix
Username: benchefe

Hey Mark,

where are you from ?
maybe non US countries trying to connect to the cloud front is not working…

I am in Europe – Germany

Viewing 25 replies - 1 through 25 (of 32 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.