Hook add_attachment error

Hook add_attachment fires before images cropped via wp_ajax_crop_image(). That’s why WordPress trying to work with files, that is not existed for now.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)