lithops-cloud / lithops

A multi-cloud framework for big data analytics and embarrassingly parallel jobs, that provides an universal API for building parallel applications in the cloud ☁️🚀
http://lithops.cloud
Apache License 2.0
317 stars 105 forks source link

ModuleNotFoundError when using ibm_cos storage and ibm_cf backend #1178

Closed foster999 closed 12 months ago

foster999 commented 12 months ago

Running hello examples lithops hello -b ibm_cf -s ibm_cos

Errors on worker:

{
   "activationId":"",
   "annotations":[
      {
         "key":"path",
         "value":"a40d8885-2cd6-4a14-b598-c0d9262a03a6/lithops_h3pe/docker.io_lithopscloud_ibmcf-python-v311_256MB_3.0.2.dev0"
      },
      {
         "key":"waitTime",
         "value":124
      },
      {
         "key":"transId",
         "value":"fc60b2c7511d58ec84e8d26cec24818c"
      },
      {
         "key":"kind",
         "value":"blackbox"
      },
      {
         "key":"timeout",
         "value":false
      },
      {
         "key":"limits",
         "value":{
            "concurrency":1,
            "logs":10,
            "memory":256,
            "timeout":600000
         }
      }
   ],
   "duration":230,
   "end":1698060335010,
   "logs":[
      "2023-10-23T11:25:34.784876Z    stdout: [INFO] __main__.py:43 -- Lithops v3.0.2.dev0 - Starting IBM CF execution",
      "2023-10-23T11:25:34.786481Z    stderr: 2023-10-23 11:25:34,786 [INFO] handler.py:60 -- Tasks received: 1 - Worker processes: 1",
      "2023-10-23T11:25:35.001624Z    stderr: 2023-10-23 11:25:35,001 [ERROR] storage.py:66 -- An exception was produced trying to create the 'ibm_cos' storage backend",
      "2023-10-23T11:25:35.006982Z    stderr: Traceback (most recent call last):",
      "2023-10-23T11:25:35.008148Z    stderr: File \"/pythonAction/pythonrunner.py\", line 88, in run",
      "2023-10-23T11:25:35.008171Z    stderr: exec('fun = %s(param)' % self.mainFn, self.global_context)",
      "2023-10-23T11:25:35.008184Z    stderr: File \"<string>\", line 1, in <module>",
      "2023-10-23T11:25:35.008196Z    stderr: File \"__main__.py\", line 44, in main",
      "2023-10-23T11:25:35.008208Z    stderr: function_handler(args)",
      "2023-10-23T11:25:35.008219Z    stderr: File \"/action/lithops/worker/handler.py\", line 68, in function_handler",
      "2023-10-23T11:25:35.008231Z    stderr: internal_storage = InternalStorage(storage_config)",
      "2023-10-23T11:25:35.008242Z    stderr: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^",
      "2023-10-23T11:25:35.008253Z    stderr: File \"/action/lithops/storage/storage.py\", line 302, in __init__",
      "2023-10-23T11:25:35.008264Z    stderr: self.storage = Storage(storage_config=storage_config)",
      "2023-10-23T11:25:35.008275Z    stderr: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^",
      "2023-10-23T11:25:35.008287Z    stderr: File \"/action/lithops/storage/storage.py\", line 68, in __init__",
      "2023-10-23T11:25:35.008298Z    stderr: raise e",
      "2023-10-23T11:25:35.008423Z    stderr: File \"/action/lithops/storage/storage.py\", line 62, in __init__",
      "2023-10-23T11:25:35.008469Z    stderr: sb_module = importlib.import_module(module_location)",
      "2023-10-23T11:25:35.008481Z    stderr: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^",
      "2023-10-23T11:25:35.008492Z    stderr: File \"/usr/local/lib/python3.11/importlib/__init__.py\", line 126, in import_module",
      "2023-10-23T11:25:35.008504Z    stderr: return _bootstrap._gcd_import(name[level:], package, level)",
      "2023-10-23T11:25:35.008515Z    stderr: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^",
      "2023-10-23T11:25:35.008526Z    stderr: File \"<frozen importlib._bootstrap>\", line 1204, in _gcd_import",
      "2023-10-23T11:25:35.008538Z    stderr: File \"<frozen importlib._bootstrap>\", line 1176, in _find_and_load",
      "2023-10-23T11:25:35.008549Z    stderr: File \"<frozen importlib._bootstrap>\", line 1147, in _find_and_load_unlocked",
      "2023-10-23T11:25:35.008560Z    stderr: File \"<frozen importlib._bootstrap>\", line 690, in _load_unlocked",
      "2023-10-23T11:25:35.008571Z    stderr: File \"<frozen importlib._bootstrap_external>\", line 940, in exec_module",
      "2023-10-23T11:25:35.008582Z    stderr: File \"<frozen importlib._bootstrap>\", line 241, in _call_with_frames_removed",
      "2023-10-23T11:25:35.008593Z    stderr: File \"/action/lithops/storage/backends/ibm_cos/__init__.py\", line 1, in <module>",
      "2023-10-23T11:25:35.008604Z    stderr: from .ibm_cos import IBMCloudObjectStorageBackend as StorageBackend",
      "2023-10-23T11:25:35.008615Z    stderr: File \"/action/lithops/storage/backends/ibm_cos/ibm_cos.py\", line 24, in <module>",
      "2023-10-23T11:25:35.008626Z    stderr: from lithops.util.ibm_token_manager import COSTokenManager, IAMTokenManager",
      "2023-10-23T11:25:35.008637Z    stderr: File \"/action/lithops/util/ibm_token_manager.py\", line 24, in <module>",
      "2023-10-23T11:25:35.008648Z    stderr: from ibm_cloud_sdk_core.authenticators import IAMAuthenticator",
      "2023-10-23T11:25:35.008658Z    stderr: ModuleNotFoundError: No module named 'ibm_cloud_sdk_core'",
      "2023-10-23T11:25:35.010Z       stderr: The action did not initialize or run as expected. Log data might be missing."
   ],
   "name":"docker.io_lithopscloud_ibmcf-python-v311_256MB_3.0.2.dev0",
   "namespace":"a40d8885-2cd6-4a14-b598-c0d9262a03a6",
   "publish":false,
   "response":{
      "result":{
         "error":"The action did not return a dictionary."
      },
      "size":52,
      "status":"action developer error",
      "success":false
   },
   "start":1698060334780,
   "subject":"",
   "version":"0.0.1"
} 

The driver terminal also hangs, because the error isn't handled on the worker and returns no response

JosepSampe commented 12 months ago

I updated the default docker image with the missing lib. It might take some time to take effect because of the caching system in IBM CF

foster999 commented 12 months ago

Running lithops clean seemed to help. Thanks, the example works for me now!