cli icon indicating copy to clipboard operation
cli copied to clipboard

Permission error when creating project from specification

Open dankar opened this issue 1 year ago • 12 comments

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 :)

dankar avatar Feb 14 '24 09:02 dankar

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.

github-actions[bot] avatar Feb 14 '24 09:02 github-actions[bot]

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 avatar Feb 15 '24 09:02 dankar

@dankar this issue seems to be related to CLI than Glee. @Souvikns can you move this issue to CLI?

KhudaDad414 avatar Mar 20 '24 20:03 KhudaDad414

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.

github-actions[bot] avatar Mar 21 '24 05:03 github-actions[bot]

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?

Souvikns avatar Mar 21 '24 06:03 Souvikns

No, what I mean is where the CLI executable is (asyncapi). I would assume nothing should need to write to the executable file :)

dankar avatar Mar 21 '24 07:03 dankar

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?

Souvikns avatar Mar 21 '24 07:03 Souvikns

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.

dankar avatar Mar 21 '24 07:03 dankar

Alright sorry for the confusion 😄, I got it now, I am checking it out 👍🏼

Souvikns avatar Mar 21 '24 07:03 Souvikns

@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"

ayushnau avatar Mar 25 '24 06:03 ayushnau

/gfi

Amzani avatar Jul 05 '24 08:07 Amzani

Hey @Amzani, your message doesn't follow the requirements, you can try /help.

asyncapi-bot avatar Jul 05 '24 08:07 asyncapi-bot

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:

github-actions[bot] avatar Nov 03 '24 00:11 github-actions[bot]