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
"No idea what *something* is!" after running fabric2 #1854
Comments
It's looking for a task function named "version" in a fabfile and not finding one.
|
Hi thank you fabric --version worked great I changed the script to look like this
I am still getting 'No idea what 'hello' is!' Is there a tutorial for fabric 2 I am having a hell of a time getting anything to work in it. I found the tutorial for fabric 1.14 but that isn't really helpful at the moment since none of the imports work. I am assuming fabric 2 handles it differently. if I run with fab or fab2 I get the same error I have fabric in /home/me/fabric |
@ajmcateer, I had this problem as well. The issue is that thew new fabric task method (as discussed here - http://docs.fabfile.org/en/1.14/usage/tasks.html) is to use the @task decorator. The equivalent "Hello World' example is:
Running 'fab hello' yields the expected output. |
I have both Additional details :
|
@mandravaze, I can confirm it worked for me, though I have task in fabfile.py (it think this is the problem in your env) and I use following line to call |
How I can troubleshoot ? What additional data would you like ? |
What files do you have in this location? I think build() should be in the fabfile.py, if it is there, perhaps your fab picks up wrong file... |
@mandarvaze in your command
|
@ploxiln |
sorry for stupid question, but why do we need 'ctx' arg? what is it? |
in fabric 2 you need this |
If your issue is that you receive this error for a task argument, it may be that you are not passing the argument in its correct format, but as how you have your task named.
not
I realize this isn't spot on the issue, but since I ended up here, I'll leave this for anybody else who has my same issue. |
First of all, thanks for the info!! Unfortunately, I have to say Fabric 2 is completely obtuse. The logic of 2.x is very counterintuitive and there really don't seem to be very many good basic tutorials on how to use it. For example, Maybe I am missing something, but look at the logic of 1.x and the quality of this 1.x tutorial: https://docs.fabfile.org/en/1.14/tutorial.html. Then look around for an equivalent tutorial for 2.x .... No wonder there is an unofficial port of 1.x and they are - quite boldy - calling it 3.x |
Just a general FYI that none of this detail around needing the I was a heavy user of Fabric 1 and naively assumed that this walkthrough was teaching me new semantics for Fabric 2 before I found this issue ticket. It could really discourage adoption as the docs are essentially misleading for people onboarding. |
I'm not sure how you ended up on that page, you should be looking at https://docs.fabfile.org/en/2.5/getting-started.html |
Thanks for that! Perhaps it would help future travelers to throw a fat "DEPRECATED" header on the 1 series docs. I'm pretty sure I navigated to this either from a top google result or the official fabric website docs, and in either case I think while the former isn't sort of something the Fabric team can control, I suspect many potential adopters are incurring this frustration and might benefit from being alerted to the need to find the up-to-date docs (the official Python hosted docs follow a similar pattern iirc). |
Brand new user of Fabric. I googled "Fabric Python", and clicked the link that said "Overview and Tutorial". Yes, I found this really confusing and am pretty surprised I was able to go the wrong way so early in the process.
Yes. Also, note that this is the result page: Those indented links can be configured if you control the domain. Maybe it's possible to purge 1.x stuff from the search results on top of adding a "DEPRECATED" header on them. |
I just stumbled on this one and finally able to fix it. Nothing is wrong with the fabric. ╰─$ fab --version
Fabric 2.5.0
Paramiko 2.7.2
Invoke 1.4.1 In my from fabric.tasks import task
@task
def test(ctx, title):
print("ctx:", ctx)
print("title:", title) If I just run the task: ╰─$ fab test
'test' did not receive required positional arguments: 'title' This means it's expecting the fab test title="hello world" Output: ctx: <your current context. Don't worry about it>
title: title=hello world But be aware that the argument passed will be a string. Be sure to split with For example: @task
def test(ctx, title):
print("ctx:", ctx)
print("title type:", type(title))
print("title:", title)
print("title value:", title.split("=")[1]) run: fab test title="hello world" Output: ctx: ...
title type: <class 'str'>
title: title=hello world
title value: hello world |
I am new to fabric and having trouble getting it to work. I installed it via pip3 first when I tried to run it I was getting Command 'fab' not found, I eventually found it in /home/me/.local/bin/fab2.
Is this the correct place?
Second whenever I run it like so
/home/me/.local/bin/fab2 version
I get
Is /home/me/.local/bin/fab2 the correct location?
What is 'No idea what 'version' is!' why does it show up?
The text was updated successfully, but these errors were encountered: