Residues in one molecule have a different 'all dihedrals' type: 0 and 1

Hello!

I am using Gromacs 2020 with Charmm36-jul2021. I want to simulate a molecule with peptide tails and hydrocarbon heads. I add the info to the .rtp file and residuetype.dat. But when I do pdb2gmx, it gives me the error:

                  Program:     gmx pdb2gmx, version 2020.5
                  Source file: src/gromacs/gmxpreprocess/pdb2top.cpp (line 896)
                  
                  Fatal error:
                  Residues in one molecule have a different 'all dihedrals' type: 0 and 1

I tested the hydrocarbon alone and the peptide alone, and both are working. But when I put them together, it fails. Also, I tried removing the [ impropers ] from the entry, but it still failed.
I searched the forum and found a similar post. However, it did not solve my problem. Could you please help?

The entry I have for my hydrocarbon is:

[ C12 ] ; Hydrocarbon head
[ atoms ]
CA CG331 -0.267 0
CB CG321 -0.185 1
CC CG321 -0.178 2
CD CG321 -0.180 3
CE CG321 -0.180 4
CF CG321 -0.180 5
CG CG321 -0.180 6
CH CG321 -0.180 7
CI CG321 -0.180 8
CJ CG321 -0.180 9
CK CG321 -0.070 10
C CG2O4 0.200 11
O OG2D1 -0.400 12
;H HGR52 0.090 13
HA1 HGA3 0.090 13
HA2 HGA3 0.090 14
HA3 HGA3 0.090 15
HB1 HGA2 0.090 16
HB2 HGA2 0.090 17
HC1 HGA2 0.090 18
HC2 HGA2 0.090 19
HD1 HGA2 0.090 20
HD2 HGA2 0.090 21
HE1 HGA2 0.090 22
HE2 HGA2 0.090 23
HF1 HGA2 0.090 24
HF2 HGA2 0.090 25
HG1 HGA2 0.090 26
HG2 HGA2 0.090 27
HH1 HGA2 0.090 28
HH2 HGA2 0.090 29
HI1 HGA2 0.090 30
HI2 HGA2 0.090 31
HJ1 HGA2 0.090 32
HJ2 HGA2 0.090 33
HK1 HGA2 0.090 34
HK2 HGA2 0.090 35
[ bonds ]
CA CB
CA HA1
CA HA2
CA HA3
CB CC
CB HB1
CB HB2
CC CD
CC HC1
CC HC2
CD CE
CD HD1
CD HD2
CE CF
CE HE1
CE HE2
CF CG
CF HF1
CF HF2
CG CH
CG HG1
CG HG2
CH CI
CH HH1
CH HH2
CI CJ
CI HI1
CI HI2
CJ CK
CJ HJ1
CJ HJ2
CK C
CK HK1
CK HK2
C O
C +N
[ impropers ]
C CK +N O

Hi,
It seems that you have a similar dihedral in the molecule that occur twice. In one case an improper dihedral (type 2) is associated to it and in another case a proper dihedral (type 1).
Since the problem occurs when you simulated the peptide-hydrocarbon system, I guess that one of the dihedrals related to the connection between the peptide and the hydrocarbon may be related to the issue.
\Alessandra