Profile Execution Issues
This guide covers issues related to profile configuration, execution, and management in the Mage2Plenty system.
Profile Configuration Issues
Issue: "Profile Not Found"
Symptoms:
Error: Profile with ID 1 does not exist
Cannot execute profile
Causes:
- Profile deleted or never created
- Wrong profile ID specified
- Database inconsistency
Solutions:
-
List existing profiles:
# Via database
mysql> SELECT entity_id, name, type_id, status FROM softcommerce_profile;
# Via Admin
# Navigate to: SoftCommerce → Profiles → Manage Profiles -
Create missing profile:
- If profile doesn't exist, create it via Admin panel
- SoftCommerce → Profiles → Manage Profiles → Add New Profile
-
Verify profile ID:
# Check which profile IDs exist
mysql> SELECT entity_id, name FROM softcommerce_profile WHERE type_id = 'plenty_item_import';
Issue: "Profile Configuration Incomplete"
Symptoms:
Error: Required configuration missing
- Client ID not configured
- Store mapping not configured
- Attribute mapping missing
Cause: Profile created but not fully configured.
Solutions:
-
Run auto-configuration:
# If profile supports auto-config, it will detect and suggest fixes
# Navigate to profile in Admin, modal will appear with suggestions -
Manual configuration checklist:
- ✅ Client Configuration:
- Client ID selected
- ✅ Store Configuration:
- Store-to-locale mapping configured
- ✅ Type-Specific Configuration:
- For items: Attribute mapping, price config, stock config
- For orders: Status mapping, payment/shipping method mapping
- For categories: Root category mapping
- ✅ Client Configuration:
-
Verify configuration:
# Export profile configuration to review
bin/magento profile:export:config --profile=1
# Check database
mysql> SELECT path, value FROM softcommerce_profile_config WHERE profile_id = 1;
Issue: "Client ID Not Configured"
Symptoms:
Error: Client ID is not configured for profile
Cannot proceed with synchronization
Solution:
# 1. Get available client ID
bin/magento plenty:system:check
# 2. Configure in profile
# SoftCommerce → Profiles → Manage Profiles → [Profile]
# Configuration → Client Configuration → Client ID
# Or set via database (emergency only)
mysql> INSERT INTO softcommerce_profile_config (profile_id, path, value)
VALUES (1, 'plenty_item_import/client_config/client_id', '12345');
Issue: "Invalid Profile Type"
Symptoms:
Error: Profile type 'plenty_item_import' is not registered
Cannot load profile
Cause: Module not enabled or not installed.
Solutions:
-
Check module status:
bin/magento module:status | grep -i plenty
-
Enable missing modules:
# For item profiles
bin/magento module:enable SoftCommerce_PlentyItemProfile
# For order profiles
bin/magento module:enable SoftCommerce_PlentyOrderProfile
# For stock profiles
bin/magento module:enable SoftCommerce_PlentyStockProfile
# Apply changes
bin/magento setup:upgrade
bin/magento cache:flush -
Verify module installation:
composer show softcommerce/* | grep plenty
Profile Execution Issues
Issue: Profile Runs But No Data Syncs
Symptoms:
- Profile execution completes without errors
- No data imported or exported
- "0 entities processed" in output
Causes:
- No entities match the profile filters
- Collection phase finds no data
- Date filters too restrictive
- Data already synchronized
Solutions:
-
Check profile filters:
# View profile configuration
bin/magento profile:export:config --profile=1
# Look for filters:
# - date_from / date_to
# - status filters
# - category filters
# - store filters -
Test without filters:
# For item import
bin/magento plenty:item:collect --verbose
bin/magento plenty:item:import --verbose
# For order export
bin/magento plenty:order:export --status=processing --verbose -
Check if data exists:
# For item import - check PlentyONE has items
# For order export - check Magento has orders
mysql> SELECT COUNT(*) FROM sales_order WHERE status = 'processing'; -
Review execution logs:
tail -f var/log/plenty_item.log
tail -f var/log/plenty_order.log
tail -f var/log/plenty_stock.log
Issue: Profile Execution Times Out
Symptoms:
Fatal error: Maximum execution time of 300 seconds exceeded
Profile execution incomplete
Causes:
- Large data set
- Insufficient timeout settings
- Slow API responses
- Complex data processing
Solutions:
-
Increase PHP timeout:
; php.ini
max_execution_time = 3600 -
Run with custom timeout:
php -d max_execution_time=3600 bin/magento plenty:item:import --verbose
-
Reduce batch size:
- Navigate to profile configuration
- Reduce
collection_size
(e.g., from 500 to 100) - Reduce
page_size
for API requests
-
Use queue-based processing:
# Process asynchronously
bin/magento queue:consumers:start plentyItemImportConsumer --max-messages=500 & -
Split into smaller operations:
# Instead of full sync
bin/magento plenty:item:import
# Process by category
bin/magento plenty:item:import --category=10
bin/magento plenty:item:import --category=20
Issue: "Memory Limit Exhausted"
Symptoms:
Fatal error: Allowed memory size of 134217728 bytes exhausted
Profile execution failed
Solutions:
-
Increase memory limit:
php -d memory_limit=2G bin/magento plenty:item:import --verbose
-
Optimize profile configuration:
- Reduce batch size
- Enable pagination
- Disable unnecessary data loading
-
Process in smaller chunks:
# By date range
bin/magento plenty:item:collect --date-updated="2025-01-01/2025-01-15"
bin/magento plenty:item:import --verbose
bin/magento plenty:item:collect --date-updated="2025-01-16/2025-01-31"
bin/magento plenty:item:import --verbose -
Use queue consumers:
- Queue processing has lower memory footprint
- Each message processed independently
Issue: Profile Execution Hangs
Symptoms:
- Profile starts but never completes
- No progress for extended period
- No errors in logs
- Process appears stuck
Causes:
- Deadlock in database
- Waiting for API response
- Infinite loop in custom code
- Lock file not released
Solutions:
-
Check for lock files:
# Check for profile locks
mysql> SELECT * FROM flag WHERE flag_code LIKE '%profile%lock%';
# Remove stale locks (if older than 1 hour)
mysql> DELETE FROM flag WHERE flag_code LIKE '%profile%lock%' AND last_update < DATE_SUB(NOW(), INTERVAL 1 HOUR); -
Check running processes:
# Find stuck PHP processes
ps aux | grep "bin/magento plenty"
# Kill stuck process if necessary
kill -9 <pid> -
Check database locks:
-- MySQL
SHOW PROCESSLIST;
SHOW ENGINE INNODB STATUS\G
-- Look for locked queries
SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCKS; -
Increase API timeout:
bin/magento config:set plenty/client_config/timeout 300
bin/magento cache:flush
Issue: Duplicate Data Processing
Symptoms:
- Same entities processed multiple times
- Duplicate items created
- Profile runs longer than expected
- "Already processed" warnings in logs
Cause: Missing or incorrect entity mapping.
Solutions:
-
Rebuild entity mappings:
# For items
bin/magento plenty:item:map
# For orders (requires filters)
bin/magento plenty:order:map --date-from="2025-01-01" --date-to="2025-01-13"
# Note: Customers are mapped automatically by email address
# No manual mapping command is needed for customers -
Verify mapping tables:
-- Check item mapping
SELECT COUNT(*), COUNT(DISTINCT magento_product_id), COUNT(DISTINCT plenty_item_id)
FROM softcommerce_plenty_item_relation;
-- Should have same counts for all three columns -
Clean up duplicate mappings:
-- Find duplicates
SELECT magento_product_id, COUNT(*)
FROM softcommerce_plenty_item_relation
GROUP BY magento_product_id
HAVING COUNT(*) > 1;
-- Remove duplicates (keep newest)
DELETE t1 FROM softcommerce_plenty_item_relation t1
INNER JOIN softcommerce_plenty_item_relation t2
WHERE t1.entity_id < t2.entity_id
AND t1.magento_product_id = t2.magento_product_id;
Cron and Scheduling Issues
Issue: Scheduled Profile Not Running
Symptoms:
- Profile configured with schedule
- Cron enabled but profile never executes
- No entries in profile history
Causes:
- Cron not installed or not running
- Profile schedule disabled
- Cron job configuration error
- Magento cron group disabled
Solutions:
-
Verify cron installation:
crontab -l | grep magento
-
Install/reinstall cron:
bin/magento cron:install
-
Check profile schedule config:
SELECT * FROM softcommerce_profile_config
WHERE path LIKE '%schedule%'
AND profile_id = 1; -
Manually run cron:
# Run Magento cron
bin/magento cron:run
# Check cron schedule table
mysql> SELECT * FROM cron_schedule WHERE job_code LIKE '%plenty%' ORDER BY scheduled_at DESC LIMIT 10; -
Enable schedule for profile:
# Via Admin
# SoftCommerce → Profiles → Manage Profiles → [Profile]
# Schedule Tab → Enable Schedule: Yes
# Via CLI
bin/magento config:set plenty_profile/schedule/<profile_id>/enabled 1 -
Check cron logs:
tail -f var/log/cron.log
Issue: Cron Jobs Run But Profile Doesn't Execute
Symptoms:
- Cron entries created in
cron_schedule
table - Status shows as "success"
- But profile doesn't actually run
Causes:
- Profile conditions not met
- Schedule expression wrong
- Profile silently fails early
- Wrong cron group configuration
Solutions:
-
Check cron schedule entries:
SELECT job_code, status, messages, scheduled_at, executed_at, finished_at
FROM cron_schedule
WHERE job_code LIKE '%plenty_profile%'
ORDER BY scheduled_at DESC
LIMIT 10; -
Review cron messages:
SELECT messages FROM cron_schedule
WHERE job_code LIKE '%plenty_profile%'
AND messages IS NOT NULL
ORDER BY scheduled_at DESC; -
Test profile manually:
# If this works but cron doesn't, it's a cron configuration issue
bin/magento plenty:item:import --verbose -
Check crontab.xml configuration:
# Verify module's crontab.xml exists
find vendor/softcommerce -name crontab.xml
# Check for syntax errors
Issue: Multiple Profile Instances Running Simultaneously
Symptoms:
- Multiple instances of same profile running
- Database locks and conflicts
- Unpredictable results
- Performance degradation
Cause: Cron overlap - profile takes longer than cron interval.
Solutions:
-
Increase cron interval:
# If profile takes 20 minutes, don't run every 15 minutes
# Change from */15 * * * * to */30 * * * * -
Enable cron locking:
// In profile configuration
'use_cron_lock' => true -
Verify no overlap:
SELECT job_code, status, scheduled_at, executed_at, finished_at
FROM cron_schedule
WHERE job_code = 'plenty_profile_item_import'
AND status = 'running';
-- Should return 0 rows when not running, 1 row max when running -
Kill duplicate processes:
# Find duplicate processes
ps aux | grep "plenty:item:import"
# Kill extras (keep one)
kill <pid>
Profile History and Logging Issues
Issue: No Profile History Recorded
Symptoms:
- Profile executes successfully
- No entries in profile history table
- Cannot track execution history
Cause: History recording not enabled or database issue.
Solutions:
-
Enable history recording:
# Via Admin
# SoftCommerce → Profiles → Manage Profiles → [Profile]
# Configuration → History → Enable: Yes -
Check database table:
-- Verify table exists
SHOW TABLES LIKE 'softcommerce_profile_history';
-- Check for recent entries
SELECT * FROM softcommerce_profile_history ORDER BY created_at DESC LIMIT 10; -
Verify database permissions:
# MySQL user should have INSERT/UPDATE permissions on profile tables
Issue: Log Files Not Created
Symptoms:
- Logs enabled but files not created
- Empty log files
- Cannot debug profile execution
Solutions:
-
Verify logging is enabled:
bin/magento config:show plenty/log_config/is_active
bin/magento config:show plenty/log_config/log_level -
Enable logging:
bin/magento config:set plenty/log_config/is_active 1
bin/magento config:set plenty/log_config/log_level info
bin/magento cache:flush -
Check file permissions:
# Ensure var/log directory is writable
ls -la var/log/
# Fix permissions if needed
chmod 755 var/log
chown www-data:www-data var/log -
Test logging:
# Run command with verbose flag
bin/magento plenty:item:import --verbose
# Check if log file is created
ls -la var/log/plenty_*.log
Profile Performance Issues
Issue: Profile Execution Very Slow
Symptoms:
- Profile takes hours to complete
- Single entity processing takes minutes
- System resources underutilized
Causes:
- Large batch sizes
- Inefficient queries
- API rate limiting
- Network latency
- Missing database indexes
Solutions:
-
Optimize batch size:
- Test different collection sizes
- Find optimal balance (usually 100-500)
-
Enable parallel processing:
# Start multiple queue consumers
for i in {1..3}; do
bin/magento queue:consumers:start plentyItemImportConsumer &
done -
Add database indexes:
-- Check for missing indexes
SHOW INDEX FROM softcommerce_plenty_item;
-- Add indexes on commonly queried columns
ALTER TABLE softcommerce_plenty_item ADD INDEX idx_sku (sku);
ALTER TABLE softcommerce_plenty_item ADD INDEX idx_plenty_item_id (plenty_item_id); -
Optimize API requests:
- Enable gzip compression
- Use appropriate filters to reduce data
- Increase API timeout for large responses
-
Schedule during off-peak hours:
# Run heavy syncs at night
0 2 * * * /usr/bin/php /path/bin/magento plenty:item:import
Issue: Profile Consumes Too Much CPU/Memory
Symptoms:
- Server CPU at 100%
- High memory usage
- System becomes unresponsive
- Other services affected
Solutions:
-
Limit resource usage:
# Use nice to lower priority
nice -n 10 bin/magento plenty:item:import
# Limit memory
php -d memory_limit=512M bin/magento plenty:item:import -
Process in smaller batches:
- Reduce
collection_size
- Add delays between batches
- Reduce
-
Use ionice for I/O:
# Lower I/O priority
ionice -c 2 -n 7 bin/magento plenty:item:import -
Schedule appropriately:
- Run during low-traffic periods
- Stagger different profile executions
- Avoid running multiple heavy profiles simultaneously
Debugging Profile Issues
Enable All Debug Logging
# Enable debug logging
bin/magento config:set plenty/log_config/is_active 1
bin/magento config:set plenty/log_config/is_active_debug 1
bin/magento config:set plenty/log_config/log_level debug
bin/magento cache:flush
View Profile Execution Details
# View profile history
mysql> SELECT * FROM softcommerce_profile_history
WHERE profile_id = 1
ORDER BY created_at DESC LIMIT 10;
# View profile configuration
mysql> SELECT path, value FROM softcommerce_profile_config
WHERE profile_id = 1;
# Export configuration for review
bin/magento profile:export:config --profile=1
Test Profile Execution
# Run profile manually with verbose output
bin/magento plenty:item:import --verbose
# Test specific entity
bin/magento plenty:item:import -i 100 --verbose
# Check execution time
time bin/magento plenty:item:import
Prevention Best Practices
-
Monitor profile execution regularly:
# Check for failures daily
mysql> SELECT COUNT(*) FROM softcommerce_profile_history
WHERE status = 'error' AND DATE(created_at) = CURDATE(); -
Set up alerts:
- Email notifications on profile failures
- Slack/Discord webhooks for errors
- Monitoring dashboard for execution times
-
Test configuration changes:
- Always test in staging first
- Validate with single entity before bulk operations
- Monitor first few executions after changes
-
Keep logs rotated:
# Configure logrotate for Magento logs
# /etc/logrotate.d/magento
/var/www/magento/var/log/*.log {
daily
rotate 14
compress
missingok
notifempty
} -
Regular maintenance:
# Clean old profile history (older than 90 days)
mysql> DELETE FROM softcommerce_profile_history
WHERE created_at < DATE_SUB(NOW(), INTERVAL 90 DAY);
# Optimize tables monthly
mysql> OPTIMIZE TABLE softcommerce_profile_history;
mysql> OPTIMIZE TABLE softcommerce_plenty_item;
Getting Help
If profile issues persist:
-
Collect diagnostic data:
# System check
bin/magento plenty:system:check > system-check.log
# Profile configuration
bin/magento profile:export:config --profile=1 > profile-config.json
# Recent history
mysql> SELECT * FROM softcommerce_profile_history
WHERE profile_id = 1
ORDER BY created_at DESC LIMIT 20; -
Gather logs:
tar -czf profile-logs.tar.gz var/log/plenty_*.log var/log/cron.log
-
Contact support with:
- Profile configuration
- Execution history
- Log files
- Steps to reproduce
- Expected vs actual behavior
Related Documentation
- Profile Creation - Create and configure profiles
- Profile Scheduling - Automate profile execution
- Common Issues - General troubleshooting
- API Errors - API error reference
Pro Tip: Most profile execution issues can be diagnosed by running the profile manually with --verbose
flag. This provides detailed output about each step of the process.