AWS ElasticBeanstalk Play Framework 2.8.8 deployment issue with CheckProcfileForJavaApplication

1

Trying to deploy a Play Framework based Application using an ELB container

Recently it seems that AWS made changes to the way ELB works as we've done this before without issue (since mid-2015 according to our GitHub logs...).

The error we currently get is:

2021/12/14 23:00:15.705423 [INFO] Executing instruction: CheckProcfileForJavaApplication
2021/12/14 23:00:15.705468 [ERROR] An error occurred during execution of command [app-deploy] - [CheckProcfileForJavaApplication]. Stop running the command. Error: there is no Procfile and no .jar file at root level of your source bundle 
2021/12/14 23:00:15.705474 [INFO] Executing cleanup logic
2021/12/14 23:00:15.705598 [INFO] CommandService Response: {"status":"FAILURE","api_version":"1.0","results":[{"status":"FAILURE","msg":"Engine execution has encountered an error.","returncode":1,"events":[{"msg":"Instance deployment failed. For details, see 'eb-engine.log'.","timestamp":1639522815,"severity":"ERROR"}]}]}

Now of course I wouldn't be here if this was the actual problem

# cd /var/app/staging/server-xxxxxxxxxxx/
# ls -l 
total 16
-rw-r--r-- 1 webapp webapp  135 Dec 14 20:39 Procfile
drwxr-xr-x 2 webapp webapp   82 Dec 14 22:21 bin
drwxr-xr-x 2 webapp webapp  113 Dec 14 22:21 conf
drwxr-xr-x 2 webapp webapp 8192 Dec 14 22:21 lib
drwxr-xr-x 3 webapp webapp   17 Dec 14 22:21 share

So Procfile exists

Hmmm is it valid however?

Let's check that out:

# cat Procfile 
web:  bin/server -v -J-Xms512M -J-Xmx2048m -J-server -Dhttp.port=5000 -Dhttps.port=8443 -Dconfig.resource=application.conf

Looks normal enough -- but does it actually work?

Short answer is yes -- if I copy and paste that command (minus the "web:" prefix of course) system comes up without any issues (ELB still fails to realize that though...)

I've tried a few variants of the command thinking that it might be related to yaml formatting for perhaps a tighter regex ^[A-Za-z0-9_-]+:\s*[^\s].*$ (source: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/platforms-linux-extend.html)

web:  bin/server
web:  ./bin/server
web: bin/server
web: ./bin/server
web:bin/server
web:./bin/server

No difference (both worked when manually started without or without the leading ./ btw)

Unsure how I move forward here?

How do we find what the real problem is so that we have fighting chance to fix it?

And yes -- the initial trace above is already the output of eb-engine.log

Using (in case this is relevant)

  • Coretto Java 11
  • Play 2.8.8
  • Scala 2.13.6
  • SBT 1.5.2

Will answer any relevant queries that help improve this question and any chance of resolving it. Most Google searches I've dug through are related to other environments and are simply a missing Profile...

I have a sneaking suspicion that whomever wrote the CheckProcfileForJavaApplication routine literally checks for Java on that line in the Procifle

Play Framework uses an intermediate launcher that then calls Java

If that is the case then how do we lunch a PlayFramework Application in ELB? (Or is there perhaps a better service to do this with?)

Question also posted on StackOverflow: https://stackoverflow.com/questions/70356726/aws-elasticbeanstalk-play-framework-2-8-8-deployment-issue-with-checkprocfilefor

techmag
asked 3 years ago913 views
1 Answer
1

There is now an answer (my answer) to this in StackOveflow: https://stackoverflow.com/a/70645590/2162886

I'll copy the answer over in a few days after any initial feedback

techmag
answered 3 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions