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

Scope missing message while trying to run the Slack Bot #168

Open
NivethanRadha opened this issue Feb 26, 2020 · 1 comment
Open

Scope missing message while trying to run the Slack Bot #168

NivethanRadha opened this issue Feb 26, 2020 · 1 comment

Comments

@NivethanRadha
Copy link

Hi Ram,

I'm successfully able to create a Slack Bot and able to use it inside my slack Workspace.
However i'm aiming to publish my Bot to the Main Slack Bot Directory, so that other Slack Workspace can use my Bot.

When i try to run, i'm getting the below error message.
(Pls do let me know if more details required.)

ERROR:
2020-02-26 14:27:21.431 ERROR 47867 --- [ main] m.r.jbot.core.slack.SlackService : Error fetching im channels for the bot:

org.springframework.http.converter.HttpMessageNotReadableException: Could not read document: Can not construct instance of me.ramswaroop.jbot.core.slack.models.Error: no String-argument constructor/factory method to deserialize from String value ('missing_scope')
at [Source: java.io.PushbackInputStream@5f462e3b; line: 1, column: 21] (through reference chain: me.ramswaroop.jbot.core.slack.models.Event["error"]); nested exception is com.fasterxml.jackson.databind.JsonMappingException: Can not construct instance of me.ramswaroop.jbot.core.slack.models.Error: no String-argument constructor/factory method to deserialize from String value ('missing_scope')
at [Source: java.io.PushbackInputStream@5f462e3b; line: 1, column: 21] (through reference chain: me.ramswaroop.jbot.core.slack.models.Event["error"])
at org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.readJavaType(AbstractJackson2HttpMessageConverter.java:228) ~[spring-web-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.read(AbstractJackson2HttpMessageConverter.java:213) ~[spring-web-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.web.client.HttpMessageConverterExtractor.extractData(HttpMessageConverterExtractor.java:95) ~[spring-web-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.web.client.RestTemplate$ResponseEntityResponseExtractor.extractData(RestTemplate.java:884) ~[spring-web-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.web.client.RestTemplate$ResponseEntityResponseExtractor.extractData(RestTemplate.java:868) ~[spring-web-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:622) ~[spring-web-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:580) ~[spring-web-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.web.client.RestTemplate.getForEntity(RestTemplate.java:312) ~[spring-web-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at me.ramswaroop.jbot.core.slack.SlackService.getImChannels(SlackService.java:64) [classes/:na]
at me.ramswaroop.jbot.core.slack.SlackService.connectRTM(SlackService.java:52) [classes/:na]
at me.ramswaroop.jbot.core.slack.Bot.startRTMAndWebSocketConnection(Bot.java:470) [classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_202]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_202]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_202]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_202]
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:365) [spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:310) [spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:133) [spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:408) [spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570) [spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545) [spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) [spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) [spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) [spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) [spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) [spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:776) [spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:861) [spring-context-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541) [spring-context-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) [spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759) [spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:369) [spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:313) [spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1185) [spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1174) [spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE]
at example.jbot.JBotApplication.main(JBotApplication.java:25) [classes/:na]
Caused by: com.fasterxml.jackson.databind.JsonMappingException: Can not construct instance of me.ramswaroop.jbot.core.slack.models.Error: no String-argument constructor/factory method to deserialize from String value ('missing_scope')
at [Source: java.io.PushbackInputStream@5f462e3b; line: 1, column: 21] (through reference chain: me.ramswaroop.jbot.core.slack.models.Event["error"])
at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:261) ~[jackson-databind-2.8.1.jar:2.8.1]
at com.fasterxml.jackson.databind.DeserializationContext.instantiationException(DeserializationContext.java:1420) ~[jackson-databind-2.8.1.jar:2.8.1]
at com.fasterxml.jackson.databind.DeserializationContext.handleMissingInstantiator(DeserializationContext.java:1011) ~[jackson-databind-2.8.1.jar:2.8.1]
at com.fasterxml.jackson.databind.deser.ValueInstantiator._createFromStringFallbacks(ValueInstantiator.java:366) ~[jackson-databind-2.8.1.jar:2.8.1]
at com.fasterxml.jackson.databind.deser.std.StdValueInstantiator.createFromString(StdValueInstantiator.java:307) ~[jackson-databind-2.8.1.jar:2.8.1]
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromString(BeanDeserializerBase.java:1276) ~[jackson-databind-2.8.1.jar:2.8.1]
at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeOther(BeanDeserializer.java:159) ~[jackson-databind-2.8.1.jar:2.8.1]
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:150) ~[jackson-databind-2.8.1.jar:2.8.1]
at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:490) ~[jackson-databind-2.8.1.jar:2.8.1]
at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:95) ~[jackson-databind-2.8.1.jar:2.8.1]
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:357) ~[jackson-databind-2.8.1.jar:2.8.1]
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:148) ~[jackson-databind-2.8.1.jar:2.8.1]
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3789) ~[jackson-databind-2.8.1.jar:2.8.1]
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2913) ~[jackson-databind-2.8.1.jar:2.8.1]
at org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.readJavaType(AbstractJackson2HttpMessageConverter.java:225) ~[spring-web-4.3.2.RELEASE.jar:4.3.2.RELEASE]
... 35 common frames omitted

2020-02-26 14:27:21.433 ERROR 47867 --- [ main] me.ramswaroop.jbot.core.slack.Bot : No web socket url returned by Slack.
------Reply from SlckWebHook
2020-02-26 14:27:22.455 INFO 47867 --- [ main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@1ea9f6af: startup date [Wed Feb 26 14:27:18 IST 2020]; root of context hierarchy
2020-02-26 14:27:22.523 INFO 47867 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/webhook],methods=[GET]}" onto public final org.springframework.http.ResponseEntity me.ramswaroop.jbot.core.facebook.Bot.setupWebhookVerification(java.lang.String,java.lang.String,java.lang.String)
2020-02-26 14:27:22.524 INFO 47867 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/webhook],methods=[POST]}" onto public final org.springframework.http.ResponseEntity me.ramswaroop.jbot.core.facebook.Bot.setupWebhookEndpoint(me.ramswaroop.jbot.core.facebook.models.Callback)
2020-02-26 14:27:22.524 INFO 47867 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/subscribe],methods=[POST]}" onto public final void me.ramswaroop.jbot.core.facebook.Bot.subscribeAppToPage()
2020-02-26 14:27:22.525 INFO 47867 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/slash-command],methods=[POST],consumes=[application/x-www-form-urlencoded]}" onto public me.ramswaroop.jbot.core.slack.models.RichMessage example.jbot.slack.SlackSlashCommand.onReceiveSlashCommand(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String)
2020-02-26 14:27:22.530 INFO 47867 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2020-02-26 14:27:22.530 INFO 47867 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2020-02-26 14:27:22.549 INFO 47867 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/webjars/] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2020-02-26 14:27:22.549 INFO 47867 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/
] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2020-02-26 14:27:22.582 INFO 47867 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2020-02-26 14:27:22.785 INFO 47867 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2020-02-26 14:27:22.864 INFO 47867 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080 (http)
2020-02-26 14:27:22.870 INFO 47867 --- [ main] example.jbot.JBotApplication : Started JBotApplication in 4.582 seconds (JVM running for 5.022)

@Elfilali-Taoufiq
Copy link

it's about a missing scope, try to verify the app's scops .

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

2 participants