Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LoadError and ArgumentError #4

Open
kahironimashte opened this issue Jul 29, 2020 · 8 comments
Open

LoadError and ArgumentError #4

kahironimashte opened this issue Jul 29, 2020 · 8 comments

Comments

@kahironimashte
Copy link

When I execute the following on Ubuntu 20.04 and Ruby 2.7

bankscrap balance Openbank --credentials=user:######### password:######

I get this error:

Traceback (most recent call last):
	11: from /usr/local/bin/bankscrap:23:in `<main>'
	10: from /usr/local/bin/bankscrap:23:in `load'
	 9: from /var/lib/gems/2.7.0/gems/bankscrap-2.1.1/bin/bankscrap:5:in `<top (required)>'
	 8: from /var/lib/gems/2.7.0/gems/thor-1.0.1/lib/thor/base.rb:485:in `start'
	 7: from /var/lib/gems/2.7.0/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'
	 6: from /var/lib/gems/2.7.0/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'
	 5: from /var/lib/gems/2.7.0/gems/thor-1.0.1/lib/thor/command.rb:27:in `run'
	 4: from /var/lib/gems/2.7.0/gems/bankscrap-2.1.1/lib/bankscrap/cli.rb:24:in `balance'
	 3: from /var/lib/gems/2.7.0/gems/bankscrap-2.1.1/lib/bankscrap/cli.rb:115:in `initialize_client_for'
	 2: from /var/lib/gems/2.7.0/gems/bankscrap-2.1.1/lib/bankscrap/cli.rb:122:in `find_bank_class_for'
	 1: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
/usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require': cannot load such file -- bankscrap-openbank (LoadError)
	17: from /usr/local/bin/bankscrap:23:in `<main>'
	16: from /usr/local/bin/bankscrap:23:in `load'
	15: from /var/lib/gems/2.7.0/gems/bankscrap-2.1.1/bin/bankscrap:5:in `<top (required)>'
	14: from /var/lib/gems/2.7.0/gems/thor-1.0.1/lib/thor/base.rb:485:in `start'
	13: from /var/lib/gems/2.7.0/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'
	12: from /var/lib/gems/2.7.0/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'
	11: from /var/lib/gems/2.7.0/gems/thor-1.0.1/lib/thor/command.rb:27:in `run'
	10: from /var/lib/gems/2.7.0/gems/bankscrap-2.1.1/lib/bankscrap/cli.rb:24:in `balance'
	 9: from /var/lib/gems/2.7.0/gems/bankscrap-2.1.1/lib/bankscrap/cli.rb:115:in `initialize_client_for'
	 8: from /var/lib/gems/2.7.0/gems/bankscrap-2.1.1/lib/bankscrap/cli.rb:122:in `find_bank_class_for'
	 7: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:156:in `require'
	 6: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:168:in `rescue in require'
	 5: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:168:in `require'
	 4: from /var/lib/gems/2.7.0/gems/bankscrap-openbank-3.0.0/lib/bankscrap-openbank.rb:1:in `<top (required)>'
	 3: from /var/lib/gems/2.7.0/gems/bankscrap-openbank-3.0.0/lib/bankscrap-openbank.rb:1:in `require_relative'
	 2: from /var/lib/gems/2.7.0/gems/bankscrap-openbank-3.0.0/lib/bankscrap/openbank/bank.rb:4:in `<top (required)>'
	 1: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
/usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require': cannot load such file -- byebug (LoadError)
	10: from /usr/local/bin/bankscrap:23:in `<main>'
	 9: from /usr/local/bin/bankscrap:23:in `load'
	 8: from /var/lib/gems/2.7.0/gems/bankscrap-2.1.1/bin/bankscrap:5:in `<top (required)>'
	 7: from /var/lib/gems/2.7.0/gems/thor-1.0.1/lib/thor/base.rb:485:in `start'
	 6: from /var/lib/gems/2.7.0/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'
	 5: from /var/lib/gems/2.7.0/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'
	 4: from /var/lib/gems/2.7.0/gems/thor-1.0.1/lib/thor/command.rb:27:in `run'
	 3: from /var/lib/gems/2.7.0/gems/bankscrap-2.1.1/lib/bankscrap/cli.rb:24:in `balance'
	 2: from /var/lib/gems/2.7.0/gems/bankscrap-2.1.1/lib/bankscrap/cli.rb:115:in `initialize_client_for'
	 1: from /var/lib/gems/2.7.0/gems/bankscrap-2.1.1/lib/bankscrap/cli.rb:121:in `find_bank_class_for'
/var/lib/gems/2.7.0/gems/bankscrap-2.1.1/lib/bankscrap/cli.rb:125:in `rescue in find_bank_class_for': Invalid bank name. (ArgumentError)

@raulmarcosl
Copy link
Member

It looks like you need bankscrap-openbank and byebug, please try to install them using gem install <gem>. Byebug shouldn't be necessary, but probably we left a requirement somewhere.

@kahironimashte
Copy link
Author

Thank you @raulmarcosl ! After installing byebug the output does look a bit better.

Now the program seems to run until it tries to access the API. I get the same error as you now even with valid credentials. I checked them on the web interface.

/var/lib/gems/2.7.0/gems/mechanize-2.7.6/lib/mechanize/http/agent.rb:329:in fetch': 400 => Net::HTTPBadRequest for https://api.openbank.es/authenticationcomposite/login -- unhandled response (Mechanize::ResponseCodeError)

When I try the call as mentioned in the bankscrap-openbank readme file with
--credentials=user:YOUR_USER --password:YOUR_PASSWORD
and not like
--credentials=user:YOUR_BANK_USER password:YOUR_BANK_PASSWORD
as mentioned in the bankscrap readme file

there is the following error:

bankscrap transactions Openbank --credentials=user:$USERNAME --password:$PASS ERROR: "bankscrap transactions" was called with arguments ["Openbank", "--password:$PASS"] Usage: "bankscrap transactions BankName" Deprecation warning: Thor exit with status 0 on errors. To keep this behavior, you must define exit_on_failure?inBankscrap::CLI You can silence deprecations warning by setting the environment variable THOR_SILENCE_DEPRECATION.

@zjuanma
Copy link
Collaborator

zjuanma commented Jan 6, 2021

You are executing the program with wrong arguments.
Try this

bankscrap transactions Openbank --credentials=user:$USERNAME password:$PASS

@kahironimashte
Copy link
Author

Thank you @zjuanma. I tried it with your suggested command and my credentials. Then I get the same error like @raulmarcosl :

/var/lib/gems/2.7.0/gems/mechanize-2.7.6/lib/mechanize/http/agent.rb:329:in fetch': 400 => Net::HTTPBadRequest for https://api.openbank.es/authenticationcomposite/login -- unhandled response (Mechanize::ResponseCodeError)

Does the bankscrap-openbank work for you as expected?

@zjuanma
Copy link
Collaborator

zjuanma commented Jan 6, 2021

Yes, I run It last week. I'll try It tomorrow.

@zjuanma
Copy link
Collaborator

zjuanma commented Jan 7, 2021

Today, It's working.

@kahironimashte
Copy link
Author

@zjuanma thanks for checking!

I assume you use openbank.es for login. I tried my credentials there and get a 400. This would explain the error.

I use openbank.de for web login. Aparently there is no domain api.openbank.de like there is a api.openbank.es.

When I am on the login-website I can select different types of login names, eg. NIF, NIE, Passaporte, Otro).

Do you know if it does matter for bankscrap-openbank what type of login one provides? Does it select a default method?

@zjuanma
Copy link
Collaborator

zjuanma commented Jan 7, 2021

Yes, I've Openbank.es account, It isn't developed for openbank.de

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

No branches or pull requests

3 participants