Back

Unable to create Appwrite function: Invalid `cpus` Param Error When Creating a Function

  • 1
  • Self Hosted
Siddhant Prateek
23 Sep, 2024, 12:55

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.
Siddhant Prateek
23 Sep, 2024, 12:55

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

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more