Site ID is missing from session data using Cron job

Hi we developed some module in Open EMR to to sync our Drug Inventory to Open EMR, using this module we upload a csv file with our Drug Inventory, and its working fine, But we want to do this automatically using cron job, but when i test this using cron i get an error in the logs “Site ID is missing from session data!”

Thanks
Casper