mapping values are not allowed in this context

Does there everyone know how to treat this error ‘yaml: line 42: mapping values are not allowed in this context’

but my yaml just only 18 lines

kind: pipeline
name: default

clone:
  disable: true
  
steps:
- name: ssh
  image: appleboy/drone-ssh
  settings:
    host:
      - web1
    username: root
    ssh_key: 
      from_secret: ssh_key
    port: 22
    script:
      - cd /data/home/lu.com && git reset --hard && git clean -df && git pull
1 Like

Hello,

I’m having exactly the same problem.
Our error is : “error”:“yaml: line 14: mapping values are not allowed in this context”,"

But it’s always the same error message even if I change the repo or if I modify the .drone.yml file.
(If the file is shorter than 14 lines we still have the same error message)

But it’s really strange because everything was working fine before.
Now this error appears for some repos but not all of them.

I’m using the latest version of drone-server and drone-agent

Did you find a solution to this ?

Regards

as an aside drone/agent was deprecated and is no longer receiving updates. you should instead be using drone/drone-runner-docker.

Hello,

Thank you for your answer.
If anyone is having the same problem there is a workaround :

  • remove the .drone.yaml and git push
  • disable the repo on Drone and enable it again
  • Put back the .drone.yaml and git push again
1 Like

We ran into this particular error when inspecting network responses while under the influence of [in progress] Drone 2.0 Builds failing, not presenting output. Deleting a file then reverting the change solved it for us.