cli
cli copied to clipboard
Permission error when creating project from specification
Describe the bug
Creating an empty project works fine with "asyncapi new glee", but if I specify an existing api spec with -f, I get the following error after it prints the api spec and allows me to select servers from it:
Error: Unable to create the project. We tried to access the "/home/xxxxx/code/mqttnew/project" directory but it was not possible due to file access permissions. Please check the write permissions of your current working directory ("/home/xxxxx/code/mqttnew").
There are no actual permissions issues since I am able to run the command in the same folder without -f, without any issues.
How to Reproduce
I would guess that this has to be related to my specific setup. I am running Debian Trixie, NPM 9.2.0 and Node v18.19.0.
I've tried installing asyncapi cli from both the latest .deb-file, as well as building it myself and running ./bin/run. Both gives the same issue.
Just let me know if any additional information is needed.
Expected behavior
The project is created :)
Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.
I did some digging and have an update to this. It works if the run-file for the CLI is left in a folder where my user has permissions, but if it's placed in /usr/bin/ or similar it fails with the error above.
@dankar this issue seems to be related to CLI than Glee. @Souvikns can you move this issue to CLI?
Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.
I did some digging and have an update to this. It works if the run-file for the CLI is left in a folder where my user has permissions, but if it's placed in /usr/bin/ or similar it fails with the error above.
Isn't this the expected behavior @dankar, since your user does not have write access so CLI can't create the project?
No, what I mean is where the CLI executable is (asyncapi). I would assume nothing should need to write to the executable file :)
Well, I think by default you don't have write access in usr/bin with rwxr-xr-x. So it should not be able to create glee project there, @dankar is CLI able to create the project without the -f flag in usr/bin?
I am not creating the project in /usr/bin. I am creating the project in my home directory, and I have full access rights there. The difference is just where the "asyncapi" executable is. If it's in /usr/bin I get the error. If I put it somewhere in my home directory, it works.
Alright sorry for the confusion 😄, I got it now, I am checking it out 👍🏼
@dankar can't reproduce this issue. I don't have a Mac. so I am using the AWS ec2 instance. @Souvikns were you able to reproduce it.
Instead, I am getting another issue which is "Unexpected value at position 0"
/gfi
Hey @Amzani, your message doesn't follow the requirements, you can try /help.
This issue has been automatically marked as stale because it has not had recent activity :sleeping:
It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.
There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.
Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.
Thank you for your patience :heart: