After upgrading mysql from 5.5 to 5.7, a compressed innodb database seems corrupted. I followed the method in this post to create a new database/table, drop the tablespace, copy the old .ibd file, then import the tablespace with ALTER TABLE mytable IMPORT TABLESPACE
but got the same error as in that post:
ERROR 1034 (HY000): Incorrect key file for table 'mytable'; try to repair it
Note that this error is not caused by insufficient disk space.