I received an error message "no residual degrees of freedom", what should I do?

This usually means you do not have enough samples to perform the analysis you specified.

When combining two metadata in an independent two-factor analysis (no blocking factors), the total number of groups will be the product of the number of levels in each metadata factor. For instance, if the primary metadata contains 3 levels, and the secondary metadata contains 4, the total number of groups will be 3 * 4 = 12. Since a minimum of 3 samples per group, therefore at least 36 samples are required in order to perform the analysis.

In this case, you should focus on a single primary metadata and leave the seconday metadata as “Not available”, and perform differential analysis with regard to individual metadata. You can then choose the other metadata as the primary metadata and perform the analysis again. If there are no or very few significant genes identified, it is most likely that incorporating the secondary metadata into the analysis will not affect the result.