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

[Kucoin Sandbox] Sample application startup fails due to http error 403 thrown during Exchange initialization #686

Closed
lucarosellini opened this issue Jul 27, 2021 · 18 comments
Assignees
Labels
bug Something isn't working

Comments

@lucarosellini
Copy link

Release number
5.0.1

Describe the bug
I get an http error 403 with response body {"code":"400007","msg":"Access denied, require more permission."} from Kucoin Sandbox while calling the endpoint https://openapi-sandbox.kucoin.com/api/v1/base-fee at Exchange initialization during the sample application startup.
The Kucoin Sandbox account used is brand new.

To Reproduce

Expected behavior
The application should start up correctly and the sample strategy should start to run.

Screenshots

Additional context
Attaching the full application startup log with logging level for 'si.mazi.rescu' set to TRACE (API Information hidden).

cassandre-app-startup.log

@straumat straumat self-assigned this Jul 27, 2021
@straumat straumat added the bug Something isn't working label Jul 27, 2021
@straumat
Copy link
Member

Hi @lucarosellini there is a problem with Kucoin Sandbox server. I send them a message to ask them to fix it but no reply yet.
For information I have a bot running 5.0.1 with Kucoin classic and it works perfectly.
Kucoin sandbox is quite often down :(

@lucarosellini
Copy link
Author

Thanks a lot for the info @straumat, I'll keep trying from time to time to check whether or not kucoin fixed the issue.

@straumat
Copy link
Member

@lucarosellini I will keep you updated if they give a reply to my email

@straumat
Copy link
Member

@lucarosellini for information, I run a strategy with positions (short and long) with 5.0.1 for 3 weeks with Kucoin and there was no problem.

@straumat
Copy link
Member

straumat commented Aug 3, 2021

@lucarosellini I'm on holiday so i will see that later but if you have time, they asked me to connect to to them throw Instagram:
Sorry for the late reply, please contact us through telegram to offer you with more convenient service: @KuCoin_API_Team01

@straumat straumat added the help wanted Extra attention is needed label Aug 6, 2021
@straumat
Copy link
Member

straumat commented Aug 9, 2021

They have a problem with the sandbox API and it will last some time... 😥
Screenshot_20210809-113733_Telegram.jpg

@straumat straumat added later Not planned for the moment and not urgent and removed help wanted Extra attention is needed labels Aug 9, 2021
@331520
Copy link

331520 commented Sep 14, 2021

HI @straumat!

The issue still exists for me. On 5.0.3 and 5.0.1, it doesn't matter. I try to connect to https://sandbox.kucoin.com/ but after executing mvn spring-boot:run always get an error


Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tech.cassandre.trading.bot.configuration.ExchangeAutoConfiguration': Invocation of init method failed; nested exception is tech.cassandre.trading.bot.util.exception.ConfigurationException: Unknown configuration error: si.mazi.resc

Could you please advise anything in this case? Thanks in advance,
Alex

@straumat
Copy link
Member

@331520 Yes. Kucoin did not update the sandbox yet. But it works perfectly in kucoin production...
For the moment, I test with drymode set to true and I run in production with sandbox to false

@331520
Copy link

331520 commented Sep 15, 2021

Thank you @straumat

@straumat straumat added waiting Waiting for more information and removed later Not planned for the moment and not urgent waiting Waiting for more information labels Oct 12, 2021
@sebasira
Copy link

Any news on this?

@straumat
Copy link
Member

@sebasira nope :
Screenshot (9)
(

@straumat straumat added the waiting Waiting for more information label Oct 28, 2021
@straumat
Copy link
Member

straumat commented Dec 2, 2021

2 December - Still got the error. If you know an exchange who have a sandbox, I would be glad to change the default account in cassandre.

@lucarosellini
Copy link
Author

@straumat thanks for the update. Bybit does have a very nice testnet, but unfortunately it's not yet supported by XChange.

@straumat
Copy link
Member

straumat commented Dec 2, 2021

@lucarosellini thx ! I will keep an eye on Xchange support for Bybit

@straumat
Copy link
Member

I had a chat two days ago with Kucoin API support team, they say they will update the sandbox within two weeks. Hope it will work. kucoin_conversation

@straumat straumat removed the waiting Waiting for more information label Dec 29, 2021
@straumat straumat added this to the 5.0.8 milestone Dec 29, 2021
@straumat straumat added the help wanted Extra attention is needed label Dec 29, 2021
@straumat
Copy link
Member

straumat commented Jan 1, 2022

Testing today, I get a new error: 401. After logging to my sandbox account I created a new API access:

cassandre.trading.bot.exchange.driver-class-name=kucoin
cassandre.trading.bot.exchange.username=kucoin.cassandre.test@gmail.com
cassandre.trading.bot.exchange.passphrase=cassandre
cassandre.trading.bot.exchange.key=61d0c8a041a5330001d0d59c
cassandre.trading.bot.exchange.secret=79edb229-a9c8-449d-a476-04689eaf376b

When I try to connect, I get this new error (with 5.0.6):

java.lang.NullPointerException
	at java.base/java.math.BigDecimal.<init>(BigDecimal.java:834)
	at org.knowm.xchange.kucoin.KucoinAdapters.adaptCurrencyMetaData(KucoinAdapters.java:172)
	at org.knowm.xchange.kucoin.KucoinAdapters.adaptMetadata(KucoinAdapters.java:115)
	at org.knowm.xchange.kucoin.KucoinExchange.remoteInit(KucoinExchange.java:102)
	at org.knowm.xchange.BaseExchange.applySpecification(BaseExchange.java:113)
	at org.knowm.xchange.kucoin.KucoinExchange.applySpecification(KucoinExchange.java:53)
	at org.knowm.xchange.ExchangeFactory.createExchange(ExchangeFactory.java:130)
	at tech.cassandre.trading.bot.configuration.ExchangeAutoConfiguration.configure(ExchangeAutoConfiguration.java:150)

I need some time to go check in the XChange library.

@straumat
Copy link
Member

straumat commented Jan 2, 2022

The error comes from the fact that, for USDN, kucoin returns null values for getWithdrawalMinFee and getWithdrawalMinSize.

I created a pull request for XChange: knowm/XChange#4376

@straumat straumat removed this from the 5.0.8 milestone Jan 2, 2022
@straumat straumat added this to the 5.0.7 milestone Jan 2, 2022
@straumat straumat removed the help wanted Extra attention is needed label Jan 2, 2022
@straumat straumat removed this from the 5.0.7 milestone Jan 6, 2022
@straumat
Copy link
Member

The problem is now solved.

In src/main/resources/application.properties, change those parameters:

cassandre.trading.bot.exchange.driver-class-name=kucoin
cassandre.trading.bot.exchange.username=kucoin.cassandre.test@gmail.com
cassandre.trading.bot.exchange.passphrase=cassandre
cassandre.trading.bot.exchange.key=61d0c8a041a5330001d0d59c
cassandre.trading.bot.exchange.secret=79edb229-a9c8-449d-a476-04689eaf376b
#
# Modes
cassandre.trading.bot.exchange.modes.sandbox=true
cassandre.trading.bot.exchange.modes.dry=false

If Xchange did not close my pull request, you have to download my XChange release and build it with: mvn clean install -Dgpg.skip -Dmaven.test.skip=true.

Then in your pom.xml, set this release:

<dependency>
   <groupId>org.knowm.xchange</groupId>
   <artifactId>xchange-kucoin</artifactId>
   <version>5.0.13-SNAPSHOT</version>
</dependency>

Yout bot should start now on the sandbox !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants