Monday, April 8, 2024

cvc-complex-type.2.4.a: Invalid content was found starting with element 'base-extension'. One of '{layoutlib}' is expected Error in Android


We were facing this issue many times when we download project from github. We are using new Android studio. 

Error was: cvc-complex-type.2.4.a: Invalid content was found starting with element 'base-extension'. One of '{layoutlib}' is expected. 

This is not the gradle issue. When we search this over internet, we get lot of answers as it's a gradle issue. But following all those solutions are in vain as this is not actually a gradle issue.

We solved this issue with some experiments. 

Android SDK configuration file ~/Library/Android/sdk/platforms/android-32/package.xml has an extra tag named base-extension compared to the same file of other API levels. Removing this tag solves the problem.
Delete downloaded Android API 32 SDK Platform from SDK Manager (Tools → SDK Manager) also solves the problem (you can redownload after deletion). Maybe the Android studio team noticed the problem, redownloading API 32 platform files, the base-extension tag disappeared from the API 32 package.xml








Sunday, April 7, 2024

Do's and Don't for a database maintenance

Here I have listed some do's and don'ts for a database project.

Do's for a Database Maintenance Project:

1. Regularly perform database backups to prevent data loss in case of system failures or disasters.
2. Monitor database performance metrics such as CPU usage, memory usage, and disk I/O to identify potential bottlenecks.
3. Implement database maintenance tasks such as index rebuilds, statistics updates, and data purging to optimize performance.
4. Conduct regular security audits to identify and mitigate vulnerabilities in the database system.
5. Document all changes made to the database structure or configuration to maintain an audit trail and facilitate troubleshooting.
6. Schedule regular downtime for maintenance activities and communicate it to stakeholders to minimize disruptions.
7. Keep database software and associated tools up to date with the latest patches and updates to ensure security and stability.
8. Test database backups and disaster recovery procedures regularly to verify their effectiveness.
9. Implement access controls and encryption mechanisms to protect sensitive data stored in the database.
10. Establish performance baselines and thresholds to proactively identify performance degradation and take corrective actions.

Don'ts for a Database Maintenance Project:

1. Don't neglect regular database maintenance tasks such as backups, index optimizations, and software updates.
2. Don't make changes to the database configuration or schema without proper testing and approval processes in place.
3. Don't ignore security vulnerabilities or delay applying security patches, as this exposes the database to potential security breaches.
4. Don't perform maintenance activities during peak usage hours without proper planning and coordination with stakeholders.
5. Don't rely solely on automated tools for database maintenance without human oversight, as they may not catch all potential issues.
6. Don't overlook performance tuning opportunities, as even small optimizations can have a significant impact on overall system performance.
7. Don't grant excessive permissions to users or applications, as this increases the risk of unauthorized access or data breaches.
8. Don't forget to document all maintenance activities and changes made to the database system for future reference and audit purposes.
9. Don't assume that backups are sufficient for disaster recovery without testing the restoration process regularly.
10. Don't overlook monitoring and alerting mechanisms to promptly identify and address any issues or anomalies in the database system.
 

Monday, March 11, 2024

RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)

When I was trying to do a git clone, I got the below error:


The error was RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: CANCEL (err 0)
some bytes of body are still expected. Unexpected disconnect while reading sideband packet. Early EOF. 
I have gone through google to solve this issue. I found different solutions. Some of them even told it's due to network. You need to change the internet operator etc. But all in vain. The correct solution is , you need to increase the buffer size of http post with the below command

git config --global http.postBuffer 157286400
After this I was able to clone the repo properly.

Happy coding

Friday, February 2, 2024

Seeding: Array[ReflectionException]Class Array does not exist Error while trying to seed the database in Laravel

While I tried to seed the database in laravel after the migration with the below artisan command,

php artisan db:seed

I received the below error: 
Seeding: Array
[ReflectionException]
Class Array does not exist

There are a few possible causes for the error message “ReflectionException: 
Class Array does not exist” that appears when Laravel tries to use a class that it cannot locate. These include: The class might not have been properly imported or required at the top of the file. The class might not have been properly imported or required at the top of the file. Composer dump-autoload may not be done.

I solved this by running the below command:

composer update

and then run:

composer dump-autoload


Now run

php artisan db:seed

It works. Happy coding