amazon-connect / amazon-connect-salesforce-scv

This repository contains resources, examples, and projects to help Service Cloud Voice customers address some common requirements as they deploy Service Cloud Voice.
Apache License 2.0
52 stars 53 forks source link

URGENT: AWSSCV Salesforce Validator function error - No module named '_cffi_backend' #173

Closed sureka-ark closed 1 month ago

sureka-ark commented 1 month ago

Hi Team,

We are facing this issue while configuring VMX. We have created a stack that is failing when we validate

VMX Python layer error

Can someone help us what is wrong in this.

Attaching our file path here

File Path for Python CFFI
dougjaso commented 1 month ago

Which version have you deployed? And are you on Service Cloud Voice?

sureka-ark commented 1 month ago

Hi Jason,

We have deployed python v3.11 and yes we are on SCV Our telephony partner is amazon connect

Yesterday, while investigating this issue, We just renamed the zip file name to awsscv_common_python.zip Sometimes it is giving success message, sometimes throwing the same error(no module error). Can you please guide us on this.

dougjaso commented 1 month ago

By version, I mean the version of VMX that you are deploying. Core example, the current version is 2024.02.28. You will see the version number at the top of the code for any of the Lambda functions.

The more important question is: Why are you using this voicemail solution instead of the native voicemail option that is included with Service Cloud Voice?

sureka-ark commented 1 month ago

Hi Jason,

We are just supporting on this and we are planning to create a new working environment for that we are just following the steps mentioned in Github., what exactly is native voicemail option included in SCV I'm not sure about this. Could you please explain a bit more on this or kindly share related documents.

Can u also let us know how to check the version of the lambda code?

Lambda Function
dougjaso commented 1 month ago

More information on the native option can be found here. Effectively, Salesforce ported this architecture into their codebase and modified it to better integrate with SCV. Unless you are coming from a legacy SCV deployment that already used VoiceMail Express, you should be using the native option from Salesforce.

Gopalakrishnareddyavuthu commented 1 month ago

Hi @dougjaso Even we are seeing this issue when we try installing VoiceMail Express. We have this solution already in Production.

This issue is in our Sandbox, Since the solution is not working in Sandbox, We have tried to remove to configure it back from scratch. However, Validation is failed with same error.

We did not face this previously.

Screenshot 2024-07-24 083823

sureka-ark commented 1 month ago

Hi @Gopalakrishnareddyavuthu , Did u found anything on this issue?

Gopalakrishnareddyavuthu commented 1 month ago

No @sureka-ark. Wating for @dougjaso to check on this as it looks it is impacting all the new implementations recently.

dougjaso commented 1 month ago

I'm trying to determine what has changed. This happened once before. Standby.

dougjaso commented 1 month ago

@Gopalakrishnareddyavuthu . @sureka-ark

While I still evaluate what has happened, i believe that I can solve for it by adding an additional layer on the packager function. Testing has solved this for the validation function.

  1. Download the patch layer
  2. Create a new lambda layer, naming it whatever you like
  3. Set the runtime for the layer to Python 3.11
  4. Use the downloaded patch_layer.zip and use it as the source for the new layer
  5. Save the layer
  6. For both the validator and the packager functions, ADD this new layer as a new layer.
  7. Test the validator function first. If that succeeds, try a voicemail.

Hopefully this solves the problem.

Gopalakrishnareddyavuthu commented 1 month ago

@dougjaso Thank you. Validation is now successful after adding the patch layer. I tried a Voicemail but case creation failed.

Checked the Packager logs and the error is not conclusive. I have tried both Queue Routing and Agent Routing, verified all the setup.

image
dougjaso commented 1 month ago

Checking now in a clean environment

dougjaso commented 1 month ago

@Gopalakrishnareddyavuthu can you please double check settings and the AWS_Utility user, app and permission sets? This is working for me on a completely clean envirnoment with no changes other than adding. the patch layer.

sf_case

Gopalakrishnareddyavuthu commented 1 month ago

@dougjaso I have verified all the settings and everything seems to be fine.

In the Packager code, I had to add the custom field names directly instead of below format which is trying to retrieve the field name.

           os.environ['sf_vmx_phone_field']: writer_payload['json_attributes']['vmx_from'],
            os.environ['sf_vmx_attributes']: json.dumps(writer_payload['json_attributes']),
            os.environ['sf_vmx_field']: sf_formatted_url

   Once this is done, Case creation is successful.

   I think we can mark this as closed. However, Can you clarify if possible why the above format did not work(Only if you get some time).
Gopalakrishnareddyavuthu commented 1 month ago

@dougjaso Please ignore above comment, While creating, we did not replace the field names. This is sorted.

dougjaso commented 1 month ago

Issue resolved. Current fix is to perform the following:

  1. Download the patch layer
  2. Create a new lambda layer, naming it whatever you like
  3. Set the runtime for the layer to Python 3.11
  4. Use the downloaded patch_layer.zip and use it as the source for the new layer
  5. Save the layer
  6. For both the validator and the packager functions, ADD this new layer as a new layer.
  7. Test the validator function first. If that succeeds, try a voicemail.

Next release will incorporate this fix.