Every time I try to create a field with Drush, I get the following error message.

WD php: FieldException: Attempt to create an instance of field section_heading [error]
without a bundle. in field_create_instance() (line 460 of
/home/dir/public_html/drupal/modules/field/field.crud.inc).
WD php: Warning: Cannot modify header information - headers already sent by    [warning]
(output started at /home/dir/src/drush/includes/drush.inc:1099) in
drupal_send_headers() (line 1018 of
/home/dir/public_html/drupal/includes/bootstrap.inc).
FieldException: Attempt to create an instance of field section_heading without a bundle. in field_create_instance() (line 460 of /home/dir/public_html/drupal/modules/field/field.crud.inc).
Drush command terminated abnormally due to an unrecoverable error.             [error]

I though this would be quite a common issue, but I have searched around and cannot find any solutions.

Comments

moshe weitzman’s picture

Status: Active » Postponed (maintainer needs more info)

What is the command you are running? Make sure you are passing a bundle argument and entity-type option if needed.

big_smile’s picture

The command I am using is this:
drush field-create

I get the options to select a widget and name a field.
However, it is when I get to the final step that the error message (see the opening post) appears.

1kubik’s picture

hi there
got the same error while installing the rooms module by drush
(on drupal 7.9 and drush all-versions 5)

'WD php: FieldException: Attempt to create a field of unknown type number_integer. in field_create_field() (line [error]
106 of /var/www/virtual/einkubik/html/modules/field/field.crud.inc).
Cannot modify header information - headers already sent by (output started at [warning]
/var/www/virtual/einkubik/drush/includes/output.inc:37) bootstrap.inc:1212
FieldException: Attempt to create a field of unknown type number_integer. in field_create_field() (line 106 of /var/www/virtual/einkubik/html/modules/field/field.crud.inc).
Drush command terminated abnormally due to an unrecoverable error. "

I though this would be quite a common issue, but I have searched around and cannot find any solutions.

yeah, me too. found nothing else except this post

could you fix this meanwhile?

best regards
stef

big_smile’s picture

I found the solution to this. When you use drush field-create you need to specify a content type.

E.g.

drush field-create news for a content type called news
drush field-create index for a content type called index

greg.1.anderson’s picture

Version: 7.x-4.5 » 8.x-6.x-dev
Status: Postponed (maintainer needs more info) » Closed (won't fix)
Issue tags: +Needs migration

This issue was marked closed (won't fix) because Drush has moved to Github.

If you still need help, please ask your question again on Drupal Answers and then post a link here to the new question. Please also change the status of this issue to closed (duplicate).

Use our Github project for contributing code, or reporting bugs, or requesting features.

greg.1.anderson’s picture

Issue summary: View changes

fixed code