Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Bug Report: Functions executed by HTTP request don't store metrics #3078

Open
2 tasks done
Shadowfita opened this issue Apr 11, 2022 · 5 comments
Open
2 tasks done
Labels
bug Something isn't working product / functions Fixes and upgrades for the Appwrite Functions.

Comments

@Shadowfita
Copy link

👟 Reproduction steps

Execute a function via http requests.

image

👍 Expected behavior

Record it's executions and CPU time in the monitor tab as expected

👎 Actual Behavior

Doesn't store any metrics

image

🎲 Appwrite version

Version 0.13.x

💻 Operating system

Linux

🧱 Your Environment

No response

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@Shadowfita Shadowfita added the bug Something isn't working label Apr 11, 2022
@christyjacob4
Copy link
Member

Can you share the logs of the usage worker ?

docker-compose logs -g appwrite-worker-usage

@Shadowfita
Copy link
Author

Shadowfita commented Apr 13, 2022

Can you share the logs of the usage worker ?

docker-compose logs -g appwrite-worker-usage

I don't receive any output when including the "-g" option. Just FYI, the metrics are stored correctly if run by an event, or through the console manually.

Thanks for your quick reply and assistance!

@christyjacob4
Copy link
Member

christyjacob4 commented Apr 14, 2022

@Shadowfita so sorry I meant
docker-compose logs -f appwrite-worker-usage

The usage worker captures and stores the usage data in the database so it should have some clues to what might be going wrong.

Also, are you triggering this function synchronously or asynchronously ?

@eldadfux eldadfux added the product / functions Fixes and upgrades for the Appwrite Functions. label Apr 17, 2022
@Shadowfita
Copy link
Author

@christyjacob4 thanks for your help with this.

Logs from execution times recently, and a repeated error that I've noticed:

appwrite-usage | �[34m[17-04-2022 10:30:33] Aggregating usage data every 30 seconds�[0m appwrite-usage | �[34m[17-04-2022 10:30:33] Aggregation took 0.0919508934021 seconds�[0m appwrite-usage | �[34m[17-04-2022 10:31:03] Aggregating usage data every 30 seconds�[0m appwrite-usage | �[34m[17-04-2022 10:31:03] Aggregating database counters.�[0m appwrite-usage | [PDO] MySQL connection restarted appwrite-usage | �[1;33mFailed to save database counters data for project collections: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'appwrite._6242e1a3eb20bd0b0e7d_collection_6242e1f68074c39eb08d' doesn't exist�[0m appwrite-usage | �[1;33m#0 /usr/src/code/src/Appwrite/Extend/PDOStatement.php(88): PDOStatement->execute(NULL) appwrite-usage | #1 /usr/src/code/vendor/utopia-php/database/src/Database/Adapter/MariaDB.php(895): Appwrite\Extend\PDOStatement->execute() appwrite-usage | #2 /usr/src/code/vendor/utopia-php/database/src/Database/Database.php(998): Utopia\Database\Adapter\MariaDB->count('collection_6242...', Array, 0) appwrite-usage | #3 /usr/src/code/app/tasks/usage.php(568): Utopia\Database\Database->count('collection_6242...') appwrite-usage | #4 /usr/src/code/vendor/utopia-php/cli/src/CLI/Console.php(203): {closure}() appwrite-usage | #5 /usr/src/code/app/tasks/usage.php(771): Utopia\CLI\Console::loop(Object(Closure), 30) appwrite-usage | #6 /usr/src/code/vendor/utopia-php/cli/src/CLI/CLI.php(233): {closure}() appwrite-usage | #7 /usr/src/code/app/cli.php(28): Utopia\CLI\CLI->run() appwrite-usage | #8 {main}�[0m appwrite-usage | [PDO] MySQL connection restarted appwrite-usage | �[1;33mFailed to save database counters data for project buckets: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'appwrite._6242e1a3eb20bd0b0e7d_bucket_6242e1b6988438ac6e64' doesn't exist�[0m appwrite-usage | �[1;33m#0 /usr/src/code/src/Appwrite/Extend/PDOStatement.php(88): PDOStatement->execute(NULL) appwrite-usage | #1 /usr/src/code/vendor/utopia-php/database/src/Database/Adapter/MariaDB.php(895): Appwrite\Extend\PDOStatement->execute() appwrite-usage | #2 /usr/src/code/vendor/utopia-php/database/src/Database/Database.php(998): Utopia\Database\Adapter\MariaDB->count('bucket_6242e1b6...', Array, 0) appwrite-usage | #3 /usr/src/code/app/tasks/usage.php(568): Utopia\Database\Database->count('bucket_6242e1b6...') appwrite-usage | #4 /usr/src/code/vendor/utopia-php/cli/src/CLI/Console.php(203): {closure}() appwrite-usage | #5 /usr/src/code/app/tasks/usage.php(771): Utopia\CLI\Console::loop(Object(Closure), 30) appwrite-usage | #6 /usr/src/code/vendor/utopia-php/cli/src/CLI/CLI.php(233): {closure}() appwrite-usage | #7 /usr/src/code/app/cli.php(28): Utopia\CLI\CLI->run() appwrite-usage | #8 {main}�[0m appwrite-usage | [PDO] MySQL connection restarted appwrite-usage | �[1;33mFailed to save database counters data for project collections: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'appwrite._62440d45b672be648df9_collection_6244764101e9f6d841de' doesn't exist�[0m appwrite-usage | �[1;33m#0 /usr/src/code/src/Appwrite/Extend/PDOStatement.php(88): PDOStatement->execute(NULL) appwrite-usage | #1 /usr/src/code/vendor/utopia-php/database/src/Database/Adapter/MariaDB.php(895): Appwrite\Extend\PDOStatement->execute() appwrite-usage | #2 /usr/src/code/vendor/utopia-php/database/src/Database/Database.php(998): Utopia\Database\Adapter\MariaDB->count('collection_6244...', Array, 0) appwrite-usage | #3 /usr/src/code/app/tasks/usage.php(568): Utopia\Database\Database->count('collection_6244...') appwrite-usage | #4 /usr/src/code/vendor/utopia-php/cli/src/CLI/Console.php(203): {closure}() appwrite-usage | #5 /usr/src/code/app/tasks/usage.php(771): Utopia\CLI\Console::loop(Object(Closure), 30) appwrite-usage | #6 /usr/src/code/vendor/utopia-php/cli/src/CLI/CLI.php(233): {closure}() appwrite-usage | #7 /usr/src/code/app/cli.php(28): Utopia\CLI\CLI->run() appwrite-usage | #8 {main}�[0m appwrite-usage | [PDO] MySQL connection restarted appwrite-usage | �[1;33mFailed to save database counters data for project buckets: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'appwrite._62440d45b672be648df9_bucket_6246841484d26490615e' doesn't exist�[0m appwrite-usage | �[1;33m#0 /usr/src/code/src/Appwrite/Extend/PDOStatement.php(88): PDOStatement->execute(NULL) appwrite-usage | #1 /usr/src/code/vendor/utopia-php/database/src/Database/Adapter/MariaDB.php(895): Appwrite\Extend\PDOStatement->execute() appwrite-usage | #2 /usr/src/code/vendor/utopia-php/database/src/Database/Database.php(998): Utopia\Database\Adapter\MariaDB->count('bucket_62468414...', Array, 0) appwrite-usage | #3 /usr/src/code/app/tasks/usage.php(568): Utopia\Database\Database->count('bucket_62468414...') appwrite-usage | #4 /usr/src/code/vendor/utopia-php/cli/src/CLI/Console.php(203): {closure}() appwrite-usage | #5 /usr/src/code/app/tasks/usage.php(771): Utopia\CLI\Console::loop(Object(Closure), 30) appwrite-usage | #6 /usr/src/code/vendor/utopia-php/cli/src/CLI/CLI.php(233): {closure}() appwrite-usage | #7 /usr/src/code/app/cli.php(28): Utopia\CLI\CLI->run() appwrite-usage | #8 {main}�[0m appwrite-usage | �[34m[17-04-2022 10:31:04] Aggregation took 0.14938497543335 seconds�[0m appwrite-usage | �[34m[17-04-2022 10:31:34] Aggregating usage data every 30 seconds�[0m appwrite-usage | �[34m[17-04-2022 10:31:34] Aggregation took 0.091359853744507 seconds�[0m

This is being executed synchronously,

@stnguyen90
Copy link
Contributor

@Shadowfita these missing table errors typically mean something went wrong during migration 👀. Any chance you'll be able to use a clean install and import the data?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working product / functions Fixes and upgrades for the Appwrite Functions.
Projects
None yet
Development

No branches or pull requests

4 participants