Broken my site: Attempt to create a field that does not exist on entity type node

by Spudley   Last Updated April 15, 2019 11:07 AM

I'm stuck with a broken site that is reporting Attempt to create a field field_myname_ that does not exist on entity type node

It's my own fault. I created the new field with an inadvertent typo in the fieldname that resulted in the system name being given a trailing underscore.

My OCD kicked in and I needed to get rid of the underscore. So I did a config export, removed all traces of the offending underscore from the yml files, and then did a config import.

Unfortunately, this has blown up in my face, and I now have a site that crashes hard on pages containing the entity in question, and nothing seems to be able to fix it.

  • I've tried re-importing the original structure.
  • I've tried re-importing the structure without the new field at all.
  • I've tried entup and updb, and of course clearing the caches after everthing I've tried.

Short of killing the whole database and rebuilding from scratch, what else can I do? (yes, I have backups, but there is of course work in progress that I'll lose if I take that path)

[edit] Here's the output of my drush entup:

# drush entup
The following updates are pending:

node entity type : 
The node.field_myfield_one_ field needs to be uninstalled.
paragraph entity type : 
The paragraph.field_myfield_two_ field needs to be uninstalled.

 Do you wish to run all pending updates? (yes/no) [yes]:
 > yes

> 
> In Connection.php line 686:
>                                                                                
>   SQLSTATE[42S02]: Base table or view not found: 1146 Table 'default.foo_node  
>   __field_myfield_one_' doesn't exist: UPDATE {node__field_class_res  
>   ults_matter_} SET deleted=:db_update_placeholder_0; Array                    
>   (                                                                            
>       [:db_update_placeholder_0] => 1                                          
>   )                                                                            
>                                                                                
> 
> In Statement.php line 59:
>                                                                                
>   SQLSTATE[42S02]: Base table or view not found: 1146 Table 'default.foo_node  
>   __field_myfield_one_' doesn't exist                                 
>                                                                                
> 
> batch:process [--format [FORMAT]] [--fields FIELDS] [--field FIELD] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-d|--debug] [-y|--yes] [--no] [--remote-host REMOTE-HOST] [--remote-user REMOTE-USER] [-r|--root ROOT] [-l|--uri URI] [--simulate] [--pipe] [-D|--define DEFINE] [--notify [NOTIFY]] [--druplicon] [--xh-link XH-LINK] [--] <command> <batch_id>
> 

In ProcessBase.php line 172:

  Output is empty.  


entity:updates [--cache-clear [CACHE-CLEAR]] [--no-cache-clear] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-d|--debug] [-y|--yes] [--no] [--remote-host REMOTE-HOST] [--remote-user REMOTE-USER] [-r|--root ROOT] [-l|--uri URI] [--simulate] [--pipe] [-D|--define DEFINE] [--notify [NOTIFY]] [--druplicon] [--xh-link XH-LINK] [--] <command>

Can this be fixed?



Related Questions


What are D8 Configuration Entities used for?

Updated May 19, 2017 15:07 PM

Feed content type field with configuration value

Updated April 07, 2017 14:07 PM


Fatal Error HtmlRouteProvider not found?

Updated January 31, 2018 20:07 PM