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

wrong path for pbjs and pbts in our sample app #402

Closed
katsutoxin opened this issue Aug 8, 2022 · 14 comments
Closed

wrong path for pbjs and pbts in our sample app #402

katsutoxin opened this issue Aug 8, 2022 · 14 comments
Labels
bug Something isn't working kalix-runtime Runtime and SDKs sub-team

Comments

@katsutoxin
Copy link
Contributor

katsutoxin commented Aug 8, 2022

Customer reported that they got some error when following the quick start guide

Here are steps to reproduce the problem....

# download sample
kalix quickstart download customer-registry-javascript

# build the sample
cd customer-registry
npm install
npm run build

We will see the following errors

/bin/sh: /xxx/customer-registry/node_modules/.bin/pbjs: No such file or directory

There are two possible solutions:

solution 1:

Add protobufjs@6.11.3 as devDependencies in in https://github.com/lightbend/kalix-javascript-sdk/blob/main/samples/js/js-customer-registry-quickstart/package.json

solution 2:

Modify the pbjs path in kalix-script.js to ./node_modules/@grpc/proto-loader/node_modules/.bin/pbjs, and the similar to pbts
https://github.com/lightbend/kalix-javascript-sdk/blob/main/npm-js/kalix-scripts/bin/kalix-scripts.js#L103-L115

One thing I feel confused is that, in https://github.com/lightbend/kalix-javascript-sdk/blob/main/samples/js/js-customer-registry-quickstart/package.json It uses kalix-script in build. However, in https://github.com/lightbend/kalix-javascript-sdk/blob/main/samples/js/js-customer-registry/package.json , it uses compile-descriptor for build instead of kalix-script, why are they different???

@jroper and @octonato , I know you are working on this area recently , especially the issue #398 Any comment on this issue?

@katsutoxin katsutoxin added bug Something isn't working kalix-runtime Runtime and SDKs sub-team labels Aug 8, 2022
@katsutoxin
Copy link
Contributor Author

Hi @octonato ,

I heard that you made a change recently? Will releasing your change to kalix quickstart download customer-registry-javascript fix the problem?

@aklikic
Copy link

aklikic commented Aug 10, 2022

I have the same problem when kickstarting a project using:
npx @kalix-io/create-kalix-entity@latest my-entity

@aklikic
Copy link

aklikic commented Aug 10, 2022

So I used your solution 1 but also had to add it to dependencies when running on Kalix

@katsutoxin
Copy link
Contributor Author

Hi @pvlugter ,

Do you have any suggestion how to fix this problem?

@pvlugter
Copy link
Member

It's awkward that grpc-js changed its dependencies in a patch version. Otherwise it would be fine.

The SDK dependencies for grpc-js and proto-loader were already changed to pinned versions in #401. So I think it should just require a release of the SDK with that change.

@pvlugter
Copy link
Member

Released version 1.0.1, which should work now.

@pvlugter
Copy link
Member

Quickstart downloads may be cached for a while, so check that it's the latest with SDK 1.0.1.

@aklikic
Copy link

aklikic commented Aug 11, 2022

I have updated to 1.0.1 and when I do npm run deploy I get this error:

#13 7.643 /home/node/node_modules/@kalix-io/kalix-scripts/bin/kalix-codegen-js.bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /home/node/node_modules/@kalix-io/kalix-scripts/bin/kalix-codegen-js.bin)
#13 7.643 /home/node/node_modules/@kalix-io/kalix-scripts/bin/kalix-codegen-js.bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /home/node/node_modules/@kalix-io/kalix-scripts/bin/kalix-codegen-js.bin)
#13 7.643 Running Invoking Kalix codegen failed, process: [/home/node/node_modules/@kalix-io/kalix-scripts/bin/kalix-codegen-js.bin], args: [--proto-source-dir,./proto,--source-dir,./src,--generated-source-dir,./lib/generated,--test-source-dir,./test]
#13 7.643 
#13 7.643 /home/node/node_modules/@kalix-io/kalix-scripts/bin/kalix-scripts.js:235
#13 7.643     throw `${actionDescription} failed.`;
#13 7.643     ^
#13 7.644 Invoking Kalix codegen failed.
#13 7.644 (Use `node --trace-uncaught ...` to show where the exception was thrown)

@aklikic
Copy link

aklikic commented Aug 11, 2022

FYI npm run test is working

@pvlugter
Copy link
Member

Ok, so that's the docker build. We'll need to look at the build for the linux codegen binary. We must have a mismatch between the machine image used in CI for building this, and the base docker image.

@aklikic
Copy link

aklikic commented Aug 11, 2022

Is there any timeline for this? Tnx

@katsutoxin
Copy link
Contributor Author

I update the PR #403 to fix this problem. I feel that we need to set the new path for pbts and pbjs. anyone want to review it

@pvlugter
Copy link
Member

@katsutoxin, the dependency issue should be fixed.

Is there any timeline for this?

I'll look at aligning these builds and publish another release today.

@pvlugter
Copy link
Member

@aklikic released 1.0.2 with a newly built codegen binary for linux, for the docker build. Works for me now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working kalix-runtime Runtime and SDKs sub-team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants