명풍 영수증 어플 상품 등록시 아래 오류가 발생하고 있는데 며칠째 진전이 없어 도움을 받을 수 있을까 하여 글 올리게되었습니다.
Invalid JSON RPC response: “RBAC: access denied”
Invalid JSON RPC response: “RBAC: access denied”
post /api/products
name test symbol test1 sellerPrivateKey 0x21a9de779f11023eb7a3fe
Refused to set unsafe header “origin”
Refused to set unsafe header “origin”
Refused to set unsafe header “origin”
Invalid JSON RPC response: “RBAC: access denied”
Invalid JSON RPC response: “RBAC: access denied”
Invalid JSON RPC response: “RBAC: access denied”
(node:8588) UnhandledPromiseRejectionWarning: Error: Invalid JSON RPC response: “RBAC: access denied”
at Object.InvalidResponse (C:\Users\yyhwe\New\node_modules\caver-js\packages\caver-core-helpers\src\errors.js:79:16)
at XMLHttpRequest.request.onreadystatechange (C:\Users\yyhwe\New\node_modules\caver-js\packages\caver-core-requestmanager\caver-providers-http\src\index.js:107:36)
at XMLHttpRequestEventTarget.dispatchEvent (C:\Users\yyhwe\New\node_modules\xhr2-cookies\dist\xml-http-request-event-target.js:34:22)
at XMLHttpRequest._setReadyState (C:\Users\yyhwe\New\node_modules\xhr2-cookies\dist\xml-http-request.js:208:14)
at XMLHttpRequest._onHttpResponseEnd (C:\Users\yyhwe\New\node_modules\xhr2-cookies\dist\xml-http-request.js:318:14)
at IncomingMessage. (C:\Users\yyhwe\New\node_modules\xhr2-cookies\dist\xml-http-request.js:289:61)
at IncomingMessage.emit (events.js:194:15)
at endReadableNT (_stream_readable.js:1125:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
(node:8588) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 10)
accessKeyID와 secretKey는 KAS Console 발급받아
‘server.js’ 와 'ProductAdd.js’에 적용하였고 'yarn dev’실행 후 웹 페이지에서
'제품 추가하기’를 하여 이미지 및 네임, 심볼 입력 후 '추가’버튼을 누르니 제품 등록 오류가 나면서 콘솔에서 발생한 에러 로그였습니다.
@maha0313 상세한 답변 감사합니다. 혹시 req.body.sellerPrivateKey 에는 값이 잘 들어갔는지 확인해보실 수 있을까요? wallet.klaytn.com 을 통해서 발급받은 키는 잘 작동해야하는 것이 맞습니다. (저도 튜토리얼을 만들 때 wallet.klaytn.com 을 통해 발급받은 키로 작업을 했습니다)
안녕하세요. 아래 코드를 wallet.klaytn.com 에서 발급받은 키로 생성했을 때에는 잘 되는 것을 확인했습니다. 혹시 괜찮으시다면 해당 키를 melvin.woo@groundx.xyz 로 보내주실 수 있을까요? 저희쪽에서도 해당 키를 가지고 디버깅해보는 것 이외에는 뚜렷한 방법은 없어보입니다. 혹시 새로 키를 발급해서 사용하셔도 동일한 증상이 나타나시나요?
안녕하세요. @maha0313 님, 제가 위 질문에도 답변을 남겼는데, 최신 KAS API와 호출 방법이 맞지 않아서 생긴 문제로 파악됩니다. 위의 링크에 제가 단 답변을 참조하셔서 최신 코드로도 한번 확인해주실 수 있을까요? 최신 코드로 업데이트한 다음, 정상작동하는 것을 확인하였습니다.
가 메시지 출력되고 다시 영수증 발행하기 버튼을 누르면 아래 errro로그가 콘솔에서 확인되면서 영수증은 발행되지 않습니다.
[0] get /api/customers/:addr 0x69a6b58ec381a4eaaf2316946d0b90bd293f6d88
[0] post /api/receipts
[0] req.body.sellerPrivateKey: 0x21a9de779f11023eb7a3fe1f0dbc2c04c920ee0f704197909001d229e4e100f2
[0] req.body.productID: 22
[0] req.body.toAddr: 0xfd3886581c0919d4dab2b5a69094a9354393794e64c3b84534202ab906127073
[0] end of /api/products post
[0] keyring.address 0x69a6b58ec381a4eaaf2316946d0b90bd293f6d88
[0] contractAddr 0x56ECb8f3140c60b6b94D36c8737245DA3A98CE9B
[0] randomID 7448206930741831
[0] we can mint
[0] (node:9436) UnhandledPromiseRejectionWarning: Error: invalid address (arg=“to”, coderType=“address”, value=“0xfd3886581c0919d4dab2b5a69094a9354393794e64c3b84534202ab906127073”, version=4.0.48)
[0] at Object.throwError (C:\Users\yyhwe\New\node_modules\ethers\errors.js:76:17)
[0] at CoderAddress.encode (C:\Users\yyhwe\New\node_modules\ethers\utils\abi-coder.js:507:20)
[0] at C:\Users\yyhwe\New\node_modules\ethers\utils\abi-coder.js:645:59
[0] at Array.forEach ()
[0] at pack (C:\Users\yyhwe\New\node_modules\ethers\utils\abi-coder.js:644:12)
[0] at CoderTuple.encode (C:\Users\yyhwe\New\node_modules\ethers\utils\abi-coder.js:804:16)
[0] at AbiCoder.encode (C:\Users\yyhwe\New\node_modules\ethers\utils\abi-coder.js:941:77)
[0] at ABICoder.encodeParameters (C:\Users\yyhwe\New\node_modules\caver-js\packages\caver-abi\src\index.js:98:27)
[0] at C:\Users\yyhwe\New\node_modules\caver-js\packages\caver-contract\src\index.js:540:28
[0] at Array.map ()
[0] (node:9436) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 16)
저한테서 발생했던 브라우저 로그입니다.
Warning: Each child in a list should have a unique “key” prop.
Check the render method of ReceiptPage. See https://fb.me/react-warning-keys for more information.
in WithStyles(ForwardRef(TableCell)) (at ReceiptPage.js:178)
in ReceiptPage (created by WithStyles(ReceiptPage))
in WithStyles(ReceiptPage) (at Product.js:9)
in div (created by ForwardRef(Container))
in ForwardRef(Container) (created by WithStyles(ForwardRef(Container)))
in WithStyles(ForwardRef(Container)) (at Product.js:8)
in Product (created by Context.Consumer)
in Route (at App.js:18)
in Switch (at App.js:17)
in div (created by Styled(MuiBox))
in Styled(MuiBox) (at App.js:10)
in App (at Root.js:7)
in Router (created by BrowserRouter)
in BrowserRouter (at Root.js:6)
in Root (at src/index.js:22)
in ThemeProvider (at src/index.js:21) index.js:1
e index.js:1
React 5
render ReceiptPage.js:174
React 8
unstable_runWithPriority scheduler.development.js:653
React 6
Warning: Can’t perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.
in ProductPage (created by WithStyles(ProductPage))
in WithStyles(ProductPage) (at Product.js:10)
in div (created by ForwardRef(Container))
in ForwardRef(Container) (created by WithStyles(ForwardRef(Container)))
in WithStyles(ForwardRef(Container)) (at Product.js:8)
in Product (created by Context.Consumer) index.js:1
getReceipts: [object Object] ReceiptPage.js:131
Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-unsafe-component-lifecycles for details.
Move data fetching code or side effects to componentDidUpdate.
If you’re updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state
Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run npx react-codemod rename-unsafe-lifecycles in your project source folder.
Please update the following components: Reader react-dom.development.js:88
handleClose
@11112@maha0313 안녕하세요. 영수증 발급시 요청되는 이미지는 영수증 수신자 주소를 나타내는 QR코드인 경우입니다. QR코드가 있으시면 이미지를 등록하셔도 되지만, 그렇지 않다면 아래의 입력창에 수신자 주소값만 입력해주셔도 정상 동작합니다. 에러 문구를 적절하게 수정해야겠네요. 두 분 다 한번 해보시고 다시 알려주실 수 있을까요?
말씀하신대로 했더니 판매자 탭은 제대로 작동합니다. 제가 아무 이미지나 올려야 되는 줄 알고 착각했네요;; 하지만 고객 탭에서 불러올 때 에러가 떠서 제대로 불러와지질 않네요… 오류 좀 봐 주셨으면 합니다.
브라우저
Warning: Each child in a list should have a unique “key” prop.
Check the render method of CustomerReceiptPage. See https://fb.me/react-warning-keys for more information.
in WithStyles(ForwardRef(TableCell)) (at CustomerReceiptPage.js:174)
in CustomerReceiptPage (created by WithStyles(CustomerReceiptPage))
in WithStyles(CustomerReceiptPage) (at Customer.js:9)
in div (created by ForwardRef(Container))
in ForwardRef(Container) (created by WithStyles(ForwardRef(Container)))
in WithStyles(ForwardRef(Container)) (at Customer.js:7)
in Customer (created by Context.Consumer)
in Route (at App.js:15)
in Switch (at App.js:13)
in div (created by Styled(MuiBox))
in Styled(MuiBox) (at App.js:10)
in App (at Root.js:7)
in Router (created by BrowserRouter)
in BrowserRouter (at Root.js:6)
in Root (at src/index.js:22)
in ThemeProvider (at src/index.js:21) index.js:1
e index.js:1
React 5
render CustomerReceiptPage.js:170
React 8
unstable_runWithPriority scheduler.development.js:653
React 26
js index.js:20
Webpack 7
getReceipts CustomerReceiptPage.js:124
Warning: Can’t perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.
in ProductPage (created by WithStyles(ProductPage))
in WithStyles(ProductPage) (at Product.js:10)
in div (created by ForwardRef(Container))
in ForwardRef(Container) (created by WithStyles(ForwardRef(Container)))
in WithStyles(ForwardRef(Container)) (at Product.js:8)
in Product (created by Context.Consumer)
in Route (at App.js:19)