Back
Unable to create Appwrite function: Invalid `cpus` Param Error When Creating a Function
- 1
- Self Hosted
I'm using self-hosted version of appwrite, so I'm trying to create a Function, but it gives me this error message
TypeScript
Invalid `cpus` param: Value must be a valid integer
this is the log that i'm getting in openruntime-executor container openruntime-executor logs:
TypeScript
openruntimes-executor | [Error] Type: Utopia\Http\Exception
openruntimes-executor | [Error] Message: Invalid `cpus` param: Value must be a valid integer
openruntimes-executor | [Error] File: /usr/local/vendor/utopia-php/framework/src/Http/Http.php
openruntimes-executor | [Error] Line: 941
openruntimes-executor | [Error] Type: Exception
openruntimes-executor | [Error] Message: Runtime not ready. Container not found.
openruntimes-executor | [Error] File: /usr/local/app/http.php
openruntimes-executor | [Error] Line: 328
TL;DR
Unable to create Appwrite function due to an 'Invalid `cpus` param: Value must be a valid integer' error. Developers are using a self-hosted version of Appwrite and trying to create a function but encountering this issue. The error log in the openruntime-executor container indicates a problem with the 'cpus' value not being an integer. Possible solution: Ensure the value of `_APP_FUNCTIONS_CPUS` is a valid integer.sample environment configuration that i'm using
TypeScript
APPWRITE_VERSION=latest #(1.6.0)
ADMIN_EMAIL=sample@example.com
ADMIN_PASSWORD=Pass
_APP_ENV=production
_APP_LOCALE=en
_APP_CONSOLE_WHITELIST_ROOT=enabled
_APP_SYSTEM_EMAIL_NAME=Appwrite
_APP_SYSTEM_EMAIL_ADDRESS=sample@example.com
_APP_SYSTEM_SECURITY_EMAIL_ADDRESS=sample@example.com
_APP_OPTIONS_ABUSE=disabled
_APP_OPTIONS_FORCE_HTTPS=disabled
_APP_OPENSSL_KEY_V1=dc804827da5967e0dsadsa5686f2
_APP_DOMAIN=example.com
_APP_DOMAIN_TARGET=example.com
_APP_REDIS_HOST=redis
_APP_REDIS_PORT=6379
_APP_DB_ROOT_PASS=PdassazdsadaGe4Y
_APP_DB_HOST=mariadb
_APP_DB_PORT=3306
_APP_DB_SCHEMA=appwrite
_APP_DB_USER=appwritte_user
_APP_DB_PASS=PdassazdsadaGe4Y
_APP_STORAGE_ANTIVIRUS=disabled
_APP_INFLUXDB_HOST=influxdb
_APP_INFLUXDB_PORT=8086
_APP_STATSD_HOST=telegraf
_APP_STATSD_PORT=8125
_APP_SMTP_HOST=172.17.0.1
_APP_SMTP_PORT=25
_APP_STORAGE_LIMIT=10000000
_APP_FUNCTIONS_TIMEOUT=900
_APP_FUNCTIONS_CONTAINERS=10
_APP_FUNCTIONS_MEMORY=256
_APP_FUNCTIONS_MEMORY_SWAP=256
_APP_MAINTENANCE_INTERVAL=86400
_APP_MAINTENANCE_RETENTION_EXECUTION=1209600
_APP_MAINTENANCE_RETENTION_ABUSE=86400
_APP_MAINTENANCE_RETENTION_AUDIT=1209600
_APP_USAGE_STATS=enabled
_APP_EXECUTOR_RUNTIME_NETWORK=appwrite_runtimes
OPEN_RUNTIMES_NETWORK=appwrite_runtimes
_APP_FUNCTIONS_RUNTIMES=php-8.0,node-18.0,python-3.9,ruby-3.1
_APP_EXECUTOR_SECRET=P30wqDzp-BZ8A-5WmxGe4Y
_APP_STORAGE_DEVICE=Local
_APP_EXECUTOR_HOST=http://exc1/v1
_APP_FUNCTIONS_RUNTIMES_NETWORK=runtimes
_APP_ASSISTANT_OPENAI_API_KEY=YOUR_OPENAI_API_KEY
_APP_DOMAIN_FUNCTIONS=functions.example.com
_APP_FUNCTIONS_CPUS=2
_APP_FUNCTIONS_SIZE_LIMIT=30000000
_APP_FUNCTIONS_BUILD_SIZE_LIMIT=2000000000
_APP_FUNCTIONS_BUILD_TIMEOUT=900
_APP_FUNCTIONS_INACTIVE_THRESHOLD=60
_APP_WORKER_PER_CORE=6
Am i missing anything for this error
Recommended threads
- [SOLVED] curl error Number: 6 — function...
Hello, I invested a lot of time in this error in a fresh install of appwrite 1.8.1 and lasted until fix, this if for helping anyone that can have the same weird...
- general_bad_request when creating accoun...
I have created a new bug request, could anyone have a look - https://github.com/appwrite/appwrite/issues/11908?
- Cannot use custom SMTP for messaging (SM...
Hey there! I'm on Appwrite Self-hosted 1.9.0. I've never used the messaging feature before, always sent emails through functions or a custom backend, but I'v...