Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Could not import file: The file has a syntax error #62

Open
hassanshaikley opened this issue Aug 10, 2016 · 3 comments
Open

Could not import file: The file has a syntax error #62

hassanshaikley opened this issue Aug 10, 2016 · 3 comments

Comments

@hassanshaikley
Copy link

Getting

`2016-08-10 15:26:10 - Txgh::TransifexApiError - Failed Transifex API call - returned status code: 400, body: Could not import file: The file has a syntax error.:

Even though when I upload the resource directly to transifex myself there are no issues.

The file I am trying to import is

https://github.com/pubpub/pubpub/blob/master/translations/en/en3.json

the type is keyvaluejson

The full stack trace:

2016-08-10 15:34:45 - Txgh::TransifexApiError - Failed Transifex API call - returned status code: 400, body: Could not import file: The file has a syntax error.:
/root/txgh/lib/txgh/transifex_api.rb:119:in raise_error!' /root/txgh/lib/txgh/transifex_api.rb:71:inupdate_content'
/root/txgh/lib/txgh/transifex_api.rb:46:in create_or_update' /root/txgh/lib/txgh/handlers/github_hook_handler.rb:81:inupload'
/root/txgh/lib/txgh/handlers/github_hook_handler.rb:71:in block (2 levels) in update_resources' /root/txgh/lib/txgh/handlers/github_hook_handler.rb:60:ineach'
/root/txgh/lib/txgh/handlers/github_hook_handler.rb:60:in block in update_resources' /root/txgh/lib/txgh/handlers/github_hook_handler.rb:54:ineach'
/root/txgh/lib/txgh/handlers/github_hook_handler.rb:54:in update_resources' /root/txgh/lib/txgh/handlers/github_hook_handler.rb:45:inexecute'
/root/txgh/lib/txgh/app.rb:114:in block in <class:Hooks>' /root/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1611:incall'
/root/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1611:in block in compile!' /root/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:975:in[]'
/root/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:975:in block (3 levels) in route!' /root/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:994:inroute_eval'
/root/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:975:in block (2 levels) in route!' /root/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1015:inblock in process_route'
/root/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1013:in catch' /root/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1013:inprocess_route'
/root/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:973:in block in route!' /root/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:972:ineach'
/root/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:972:in route!' /root/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1085:inblock in dispatch!'
/root/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1067:in block in invoke' /root/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1067:incatch'
/root/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1067:in invoke' /root/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1082:indispatch!'
/root/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:907:in block in call!' /root/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1067:inblock in invoke'
/root/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1067:in catch' /root/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1067:ininvoke'
/root/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:907:in call!' /root/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:895:incall'
/root/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rack-protection-1.5.3/lib/rack/protection/xss_header.rb:18:in call' /root/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rack-protection-1.5.3/lib/rack/protection/path_traversal.rb:16:incall'
/root/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rack-protection-1.5.3/lib/rack/protection/json_csrf.rb:18:in call' /root/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:incall'
/root/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in call' /root/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:incall'
/root/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/head.rb:13:in call' /root/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:182:incall'
/root/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:2013:in call' /root/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/urlmap.rb:66:inblock in call'
/root/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/urlmap.rb:50:in each' /root/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/urlmap.rb:50:incall'
/root/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/puma-3.6.0/lib/puma/configuration.rb:225:in call' /root/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/puma-3.6.0/lib/puma/server.rb:578:inhandle_request'
/root/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/puma-3.6.0/lib/puma/server.rb:415:in process_client' /root/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/puma-3.6.0/lib/puma/server.rb:275:inblock in run'
/root/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/puma-3.6.0/lib/puma/thread_pool.rb:116:in call' /root/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/puma-3.6.0/lib/puma/thread_pool.rb:116:inblock in spawn_thread'

@matthewjackowski
Copy link
Contributor

You are seeing a 400 error which actually means something is wrong with what you are sending in the request to Transifex. This doesn't necessarily mean that theres an issue with the file itself. It is likely the file mapping you have set in tx.config.

I was able to upload your file through my test Txgh without issue. Here is the tx.config I used:

[txgh-test-1.en3json]
file_filter = translations/<lang>/<lang>.json
source_file = translations/en/en3.json
source_lang = en
type = KEYVALUEJSON

I hope that helps!

@hassanshaikley
Copy link
Author

Do trial memberships work with KEYVALUEJSON files?

The chrome file works for me, but I can't get keyvaluejson to work.

@matthewjackowski
Copy link
Contributor

As far as I am aware it should. If you created something manually in Transifex for json, you might try removing that resource and letting Txgh auto create it.
If you have more questions about trials, here is the right place to ask: https://www.transifex.com/contact/

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

No branches or pull requests

2 participants