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

Permission error when creating project from specification #1288

Open
dankar opened this issue Feb 14, 2024 · 12 comments
Open

Permission error when creating project from specification #1288

dankar opened this issue Feb 14, 2024 · 12 comments
Labels
bug Something isn't working

Comments

@dankar
Copy link

dankar commented Feb 14, 2024

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 dankar added the bug Something isn't working label Feb 14, 2024
Copy link
Contributor

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.

@dankar
Copy link
Author

dankar commented Feb 15, 2024

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.

@KhudaDad414
Copy link
Member

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

@Souvikns Souvikns transferred this issue from asyncapi/glee Mar 21, 2024
Copy link
Contributor

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.

@Souvikns
Copy link
Member

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?

@dankar
Copy link
Author

dankar commented Mar 21, 2024

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

@Souvikns
Copy link
Member

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?

@dankar
Copy link
Author

dankar commented Mar 21, 2024

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.

@Souvikns
Copy link
Member

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

@ayushnau
Copy link
Contributor

ayushnau commented Mar 25, 2024

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

@Amzani
Copy link
Collaborator

Amzani commented Jul 5, 2024

/gfi

@asyncapi-bot
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Backlog
Development

No branches or pull requests

6 participants