Batch mode failed in AWS Lambda with CURL 26 error "read function returned funny value"
AnsweredHello, I was trying to test out a batch mode implementation in AWS Lambda but ran into this “read function returned funny value” error 26. Verbose logs showed it's a CURL command PUT error, looks like it's trying to upload something to the cluster manager but couldn't.
I have a working license with CSManager, CSAPIAccessID, CSAPISecret params and I successfully set it up for the gurobi environment.
The part in AWS Lambda loads and constructs a model using an existing *.mps file and *.attr file saved in the AWS Lambda storage folder "/tmp", and later when the model is run, I followed the example batchmode.py very closely but the error came up at the model.optimizeBatch() step.
Very curiously, by turning off batch mode and simply does m.optimize() it works with no issue, and I see from the log that it's contacting the URL of the cluster manager.
Why m.optimize() works but m.optimizeBatch() doesn't is very confusing to me. Would really appreciate help from anyone who has experience working with batch mode in AWS Lambda or similar serverless environments!
FYI the gurobi version is 12.0.2 build v12.0.2rc0 (linux 64 - “AWS Linux 2”)
Thanks a lot in advance!!
-
Hello Hancheng,
The error you're receiving might be related to AWS Lambda runtime, or how it handles the /tmp directory. On your client machine that connects to the cluster manager, can you try submitting a model using the command
grbcluster batch solve <model_name>. If this works, then it suggests that the error is within the Lambda.Additionally, I recommend writing the Lambda's output model to S3 instead of the
/tmpfolder, and then trying to submit the batch job using the model from S3. This can help determine whether the problem is specific to the /tmp directory.Regards,
Alex0
Please sign in to leave a comment.
Comments
1 comment