in many places like theses, you leave defaultProjectId instead of using projectId. Either we need to set defaultProjectId when it is not part of the environment or get rid of it and simply set projectId to the defaultProjectId if present (and, probably, if it is in the list when you go a getProjects)