Skip to content
This repository has been archived by the owner on Jun 2, 2021. It is now read-only.

undefined method `content_types' for #<Contentful::Management::AccessDenied> (NoMethodError) #32

Open
joshRpowell opened this issue Mar 23, 2017 · 1 comment

Comments

@joshRpowell
Copy link

hi @dlitvakb

Importer is failing after Create JSON files with content types structure...

I, [2017-03-23T12:37:10.043467 #62227]  INFO -- : Converting Contentful model to Contentful import structure...
I, [2017-03-23T12:37:10.045685 #62227]  INFO -- : Done! Contentful import structure file saved in /Users/jpowell/Dropbox/Clients/milnergroup.com/contentful_structure.json
I, [2017-03-23T12:37:10.046089 #62227]  INFO -- : Create JSON files with content types structure...
I, [2017-03-23T12:37:10.061642 #62227]  INFO -- : Saving author.json to /Users/jpowell/Dropbox/Clients/milnergroup.com/collections
I, [2017-03-23T12:37:10.062083 #62227]  INFO -- : Saving category.json to /Users/jpowell/Dropbox/Clients/milnergroup.com/collections
I, [2017-03-23T12:37:10.062522 #62227]  INFO -- : Saving post.json to /Users/jpowell/Dropbox/Clients/milnergroup.com/collections
I, [2017-03-23T12:37:10.062913 #62227]  INFO -- : Saving tag.json to /Users/jpowell/Dropbox/Clients/milnergroup.com/collections
I, [2017-03-23T12:37:10.063347 #62227]  INFO -- : Saving blog.json to /Users/jpowell/Dropbox/Clients/milnergroup.com/collections
I, [2017-03-23T12:37:10.063402 #62227]  INFO -- : Done!
/Users/jpowell/.rvm/gems/ruby-2.3.1@milnergroup/gems/contentful-importer-0.2.2/lib/contentful/importer/parallel_importer.rb:396:in `create_new_content_type': undefined method `content_types' for #<Contentful::Management::AccessDenied:0x007fd5bb4a6ff8> (NoMethodError)
	from /Users/jpowell/.rvm/gems/ruby-2.3.1@milnergroup/gems/contentful-importer-0.2.2/lib/contentful/importer/parallel_importer.rb:196:in `block in import_content_types'
	from /Users/jpowell/.rvm/gems/ruby-2.3.1@milnergroup/gems/contentful-importer-0.2.2/lib/contentful/importer/parallel_importer.rb:194:in `glob'
	from /Users/jpowell/.rvm/gems/ruby-2.3.1@milnergroup/gems/contentful-importer-0.2.2/lib/contentful/importer/parallel_importer.rb:194:in `import_content_types'
	from /Users/jpowell/.rvm/gems/ruby-2.3.1@milnergroup/gems/contentful-importer-0.2.2/lib/contentful/importer/parallel_importer.rb:26:in `create_contentful_model'
	from /Users/jpowell/.rvm/gems/ruby-2.3.1@milnergroup/gems/contentful-importer-0.2.2/lib/contentful/importer/import_model.rb:21:in `import'
	from /Users/jpowell/.rvm/gems/ruby-2.3.1@milnergroup/gems/contentful-importer-0.2.2/lib/contentful/importer/import.rb:18:in `run'
	from /Users/jpowell/.rvm/gems/ruby-2.3.1@milnergroup/gems/claide-0.8.2/lib/claide/command.rb:312:in `run'
	from /Users/jpowell/.rvm/gems/ruby-2.3.1@milnergroup/gems/contentful-importer-0.2.2/bin/contentful-importer:12:in `<top (required)>'
	from /Users/jpowell/.rvm/gems/ruby-2.3.1@milnergroup/bin/contentful-importer:22:in `load'
	from /Users/jpowell/.rvm/gems/ruby-2.3.1@milnergroup/bin/contentful-importer:22:in `<main>'
	from /Users/jpowell/.rvm/gems/ruby-2.3.1@milnergroup/bin/ruby_executable_hooks:15:in `eval'
	from /Users/jpowell/.rvm/gems/ruby-2.3.1@milnergroup/bin/ruby_executable_hooks:15:in `<main>'

here is my importer-settings.yml:

#PATH to all data
wordpress_xml_path: /Users/jpowell/Downloads/themilnergroup.wordpress.2017-03-23.xml
data_dir: /Users/jpowell/Dropbox/Clients/milnergroup.com

#Contentful credentials
access_token:
organization_id:
space_id:
default_locale: en-US

## CONVERT CONTENTFUL MODEL TO CONTENTFUL IMPORT STRUCTURE

#JSON describing your content model
content_model_json: /Users/jpowell/Dropbox/Clients/milnergroup.com/contentful_model.json
converted_model_dir: /Users/jpowell/Dropbox/Clients/milnergroup.com/contentful_structure.json
contentful_structure_dir: /Users/jpowell/Dropbox/Clients/milnergroup.com/contentful_structure.json
  • Am I missing something in my config?
@mzzroboto
Copy link

You need to get the Content Management API Token and set it to access_token. The Content Delivery API is read only.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants