Giter VIP home page Giter VIP logo

Comments (26)

fededalla2 avatar fededalla2 commented on June 15, 2024 1

Finally I was able to get it working by manually downloading the wordpress_docker.zip file, changing each of the files to UNIX EOL. Then build locally in my machine, push to remote the latest tag and deploy the ECS Task.

from terraform-aws-serverless-static-wordpress.

petewilcock avatar petewilcock commented on June 15, 2024 1

Aha, now - this is some kind of weird DNS lag I've seen a few times. The solution seems to be to just.... wait a few minutes and try again, and the DNS resolves and it'll work. Not sure if this is an issue with the Guzzle library or what but it's quite perplexing.

For plugin-specific issues I'd check their issue page and raise anything that looks new :)

from terraform-aws-serverless-static-wordpress.

fededalla2 avatar fededalla2 commented on June 15, 2024 1

Just for the record, I finally was getting permission denied due to missing ACL credentials. I went to the plugin option and put ACL as private and the publishing worked.

from terraform-aws-serverless-static-wordpress.

leonstafford avatar leonstafford commented on June 15, 2024 1

Please feel free to load up WP2Static or the S3 addon's repos with any relevant issues.

from terraform-aws-serverless-static-wordpress.

fededalla2 avatar fededalla2 commented on June 15, 2024 1

I'm good, we can close it. The work being done in this project is amazing and I really like it. I will some day try to fix these Windows-specific issues from a fresh installation and propose those changes.

from terraform-aws-serverless-static-wordpress.

CarterSheehan avatar CarterSheehan commented on June 15, 2024 1

Finally I was able to get it working by manually downloading the wordpress_docker.zip file, changing each of the files to UNIX EOL. Then build locally in my machine, push to remote the latest tag and deploy the ECS Task.

This is a very unique issue not so far seen by other Windows users. I'll do further investigation on how the module could install with CLRF line endings. They are all LF in the repo source.

I am experiencing the same issue; I am on Windows 10 and when I check the line endings of the files inside wordpress_docker.zip in my cached terraform files, they are all in Windows line endings:

image

EDIT:
I adjusted git to pull using Linux line endings and now the ECS service has launched successfully

from terraform-aws-serverless-static-wordpress.

petewilcock avatar petewilcock commented on June 15, 2024

Thanks for this and the level of detail. Everything looks correct and I can't see anything about the build or spec that would cause this - but can I ask - are you running Terraform from Windows?

From what I can see most common cause of this error seems to be CRLF line endings in Windows: https://stackoverflow.com/questions/51508150/standard-init-linux-go190-exec-user-process-caused-no-such-file-or-directory

It's possible if you cloned the repo from within Windows, it's mutating the line endings and messing with the entrypoint script just enough to make it break...?

You can probably confirm this by checking your local cache of the module and seeing what the line-endings are:

https://stackoverflow.com/questions/3569997/how-to-find-out-line-endings-in-a-text-file

It feels quite unlikely but it's one possibility.

Can you also try re-triggering the CodeBuild pipeline and building the container again? Just to rule out some kind of strange build-time anomaly.

from terraform-aws-serverless-static-wordpress.

fededalla2 avatar fededalla2 commented on June 15, 2024

I'm running it from Windows actually and I had to clone the repo locally due to the RDS password limitation, however I could try again directly from the source module (and just retry until no @ is being used). Have you done the whole execution from a Linux environment?

Re-running the code base success but the problem persists.

from terraform-aws-serverless-static-wordpress.

petewilcock avatar petewilcock commented on June 15, 2024

This must be the cause - you have probably set your git to check out with windows line endings. This seems to break the docker-entrypoint.sh script and it fails to launch after building.

https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings

But I have just released 0.1.2 to fix the RDS password issue and updated the docs to reflect your other feedback - so you can use this without cloning now. Let me know if this works for you - you will need to update and re-run the CodeBuild to generate a refresh image.

from terraform-aws-serverless-static-wordpress.

fededalla2 avatar fededalla2 commented on June 15, 2024

Tried once more with the remote repository and changing the git new lines handling but still with the same issue. Will try later, probably with a full destroy+apply.

Note: I still had to run docker and codebase manually:

module.docker_pullpush.null_resource.docker_pullpush: Creating... module.docker_pullpush.null_resource.docker_pullpush: Provisioning with 'local-exec'... module.docker_pullpush.null_resource.docker_pullpush (local-exec): Executing: ["cmd" "/C" ".terraform/modules/docker_pullpush/docker_pullpush.sh wordpress:php7.4-apache us-east-2 183218488412 viajesconanto-serverless-wordpress base default"] module.docker_pullpush.null_resource.docker_pullpush (local-exec): '.terraform' is not recognized as an internal or external command, module.docker_pullpush.null_resource.docker_pullpush (local-exec): operable program or batch file. ╷ │ Error: local-exec provisioner error │ │ with module.docker_pullpush.null_resource.docker_pullpush, │ on .terraform\modules\docker_pullpush\main.tf line 10, in resource "null_resource" "docker_pullpush": │ 10: provisioner "local-exec" { │ │ Error running command '.terraform/modules/docker_pullpush/docker_pullpush.sh wordpress:php7.4-apache us-east-2 183218488412 │ viajesconanto-serverless-wordpress base default': exit status 1. Output: '.terraform' is not recognized as an internal or │ external command, │ operable program or batch file. │ ╵

from terraform-aws-serverless-static-wordpress.

petewilcock avatar petewilcock commented on June 15, 2024

OK - I think the docker push is again a Windows-specific issue, try updating the definition to: TechToSpeech/ecr-mirror/aws version 0.0.7 - I believe it fixes this specific case.

from terraform-aws-serverless-static-wordpress.

Ojaybee avatar Ojaybee commented on June 15, 2024

This must be the cause - you have probably set your git to check out with windows line endings. This seems to break the docker-entrypoint.sh script and it fails to launch after building.

This worked for me. I checked the cached version of docker-entrypoint.sh (.\modules\codebuild\codebuild_files) and the line endings were Windows.

from terraform-aws-serverless-static-wordpress.

Ojaybee avatar Ojaybee commented on June 15, 2024

Tried once more with the remote repository and changing the git new lines handling but still with the same issue. Will try later, probably with a full destroy+apply.

Note: I still had to run docker and codebase manually:

module.docker_pullpush.null_resource.docker_pullpush: Creating... module.docker_pullpush.null_resource.docker_pullpush: Provisioning with 'local-exec'... module.docker_pullpush.null_resource.docker_pullpush (local-exec): Executing: ["cmd" "/C" ".terraform/modules/docker_pullpush/docker_pullpush.sh wordpress:php7.4-apache us-east-2 183218488412 viajesconanto-serverless-wordpress base default"] module.docker_pullpush.null_resource.docker_pullpush (local-exec): '.terraform' is not recognized as an internal or external command, module.docker_pullpush.null_resource.docker_pullpush (local-exec): operable program or batch file. ╷ │ Error: local-exec provisioner error │ │ with module.docker_pullpush.null_resource.docker_pullpush, │ on .terraform\modules\docker_pullpush\main.tf line 10, in resource "null_resource" "docker_pullpush": │ 10: provisioner "local-exec" { │ │ Error running command '.terraform/modules/docker_pullpush/docker_pullpush.sh wordpress:php7.4-apache us-east-2 183218488412 │ viajesconanto-serverless-wordpress base default': exit status 1. Output: '.terraform' is not recognized as an internal or │ external command, │ operable program or batch file. │ ╵

I was having the same problem. Using Docker Desktop make sure WSL2 is set up and you have a Linux distro installed on windows.
https://andrewlock.net/installing-docker-desktop-for-windows/
Once set up launch the distro and install awscli v2 on it.
Then follow these steps:
#9 (comment)
I included full access to CodeBuild permissions for the created user as well.

from terraform-aws-serverless-static-wordpress.

chathamdl avatar chathamdl commented on June 15, 2024

I had the same issue on server 2019, trying the 0.0.7 now. thanks

from terraform-aws-serverless-static-wordpress.

chathamdl avatar chathamdl commented on June 15, 2024

Looks like 0.0.7 did not resolve this for me. Getting CannotPullContainerError: inspect image has been retried 1 time(s): failed to resolve ref "090879126685.dkr.ecr.us-east-1.amazonaws.com/tectalk-serverless-wordpress:latest":

image

from terraform-aws-serverless-static-wordpress.

petewilcock avatar petewilcock commented on June 15, 2024

In your case @chathamdl - did you run the CodeBuild job? This must be run at least one to populate the customised container to your ECR repository.

from terraform-aws-serverless-static-wordpress.

fededalla2 avatar fededalla2 commented on June 15, 2024

I was able to run everything by referencing the remote terraform modules, I had to instal WSL version 2 with an AWS CLI 2 also, ran successful but when trigerring the ECS Task still fails with the same error message. I tried twice, deleting all ECS Images and Builds just in case but without any luck.

from terraform-aws-serverless-static-wordpress.

chathamdl avatar chathamdl commented on June 15, 2024

So the codebuild job fails for me saying no image exists.

image

from terraform-aws-serverless-static-wordpress.

petewilcock avatar petewilcock commented on June 15, 2024

@chathamdl You are mixing your issue here. You have not pushed the base image to ECR. Check readme for instructions.

from terraform-aws-serverless-static-wordpress.

petewilcock avatar petewilcock commented on June 15, 2024

Finally I was able to get it working by manually downloading the wordpress_docker.zip file, changing each of the files to UNIX EOL. Then build locally in my machine, push to remote the latest tag and deploy the ECS Task.

This is a very unique issue not so far seen by other Windows users. I'll do further investigation on how the module could install with CLRF line endings. They are all LF in the repo source.

from terraform-aws-serverless-static-wordpress.

chathamdl avatar chathamdl commented on June 15, 2024

pete will do, just look like the same thing. apologies.

from terraform-aws-serverless-static-wordpress.

fededalla2 avatar fededalla2 commented on June 15, 2024

Everything works well after the workaround above mentioned, except for the WP2Static plugin, for sure a different issue:
image

from terraform-aws-serverless-static-wordpress.

petewilcock avatar petewilcock commented on June 15, 2024

OK @fededalla2, almost there. Now we're down to wp2static quirks. Best thing to do now is check cloudwatch log groups for ECS and report on the php fatal error there.

from terraform-aws-serverless-static-wordpress.

fededalla2 avatar fededalla2 commented on June 15, 2024

Almost there.. not sure how "Could not resolve host" since I'm accessing to the site directly using that host, hopefully is not related to SSL and is just DNS propagation. Will try it in a while again:
[Fri Jun 25 15:32:47.329251 2021] [php7:error] [pid 269] [client 181.9.169.71:2472] PHP Fatal error: Uncaught WP2StaticGuzzleHttp\\Exception\\ConnectException: cURL error 6: Could not resolve host: wordpress.viajesconanto.com (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://wordpress.viajesconanto.com/robots.txt in /var/www/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticguzzle/src/Handler/CurlFactory.php:210\nStack trace:\n#0 /var/www/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticguzzle/src/Handler/CurlFactory.php(158): WP2StaticGuzzleHttp\\Handler\\CurlFactory::createRejection()\n#1 /var/www/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticguzzle/src/Handler/CurlFactory.php(110): WP2StaticGuzzleHttp\\Handler\\CurlFactory::finishError()\n#2 /var/www/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticguzzle/src/Handler/CurlHandler.php(47): WP2StaticGuzzleHttp\\Handler\\CurlFactory::finish()\n#3 /var/www/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticguzzle/src/Handler/Proxy.php(28): WP2StaticGuzzleHttp\\Handler\\CurlHandler->__invo in /var/www/html/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticguzzle/src/Handler/CurlFactory.php on line 210, referer: http://wordpress.viajesconanto.com/wp-admin/admin.php?page=wp2static

from terraform-aws-serverless-static-wordpress.

Ojaybee avatar Ojaybee commented on June 15, 2024

Looks good to me!
image

from terraform-aws-serverless-static-wordpress.

petewilcock avatar petewilcock commented on June 15, 2024

Just for the record, I finally was getting permission denied due to missing ACL credentials. I went to the plugin option and put ACL as private and the publishing worked.

For the publish step? This is possible actually, the bucket permissions are locked down so I should probably pre-configure the S3 add-on to set the ACL as private always. If you're good now @fededalla2 I'll close this :)

from terraform-aws-serverless-static-wordpress.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.