GithubHelp home page GithubHelp logo

Comments (7)

dconeybe avatar dconeybe commented on May 27, 2024 1

A quick Google search brought me to this post: https://stackoverflow.com/a/62171642/12975006

Could you ensure that your security rules in the emulator are sufficiently permissive to allow the writes?

from firebase-unity-sdk.

dconeybe avatar dconeybe commented on May 27, 2024 1

I've logged b/202835732 (for Googlers) to see what we can do to improve the error message produced when a Firestore operation is rejected by security rules.

from firebase-unity-sdk.

dconeybe avatar dconeybe commented on May 27, 2024

Hi @dex3r. The Firestore emulator is working fine for me. I'm going to need some more information to help out.

  1. Can you enable debug logging in Firestore? To do this, call FirebaseFirestore.LogLevel = LogLevel.Debug; before doing anything else.
  2. What version of the Unity SDK are you using (please use the latest, 8.3.0)?
  3. What OS are you running the Unity Editor on (e.g. Mac, Linux, Windows)?
  4. What OS are you running the code on? (e.g. Android, iOS, via play button in Unity Editor)?
  5. What command line did you run to start the Firestore emulator?
  6. Do you have the latest version of the Firestore emulator?
  7. Can you attach the full log output (e.g. Unity Editor log, Android logcat)?
  8. Can you show a larger code snippet of your code?

After answering these questions, could you create a minimal app that you use to reproduce the issue? Then I could clone it and try it out for myself to see if I can reproduce what you're seeing.

from firebase-unity-sdk.

dex3r avatar dex3r commented on May 27, 2024

Test code (empty scene with only this object):

using System.Collections.Generic;
using System.Threading.Tasks;
using Firebase;
using Firebase.Firestore;
using UnityEngine;

public class FirestoreEmulatorTest : MonoBehaviour
{
    async void Start()
    {
        Debug.Log("TEST START");
        
        FirebaseFirestore.DefaultInstance.Settings.Host = "localhost:8080";
        FirebaseFirestore.DefaultInstance.Settings.SslEnabled = false;
        FirebaseFirestore.DefaultInstance.Settings.PersistenceEnabled = false;

        FirebaseFirestore.LogLevel = LogLevel.Debug;
        
        await WriteToEmulator();
    }
    
    async Task WriteToEmulator()
    {
        var docRef = FirebaseFirestore.DefaultInstance.Document("testL/test");
        var documentData = new Dictionary<string, object>();

        await docRef.SetAsync(documentData);
        Debug.Log("Write done");
    }
}
  1. 8.3.0
  2. Windows 10
  3. Editor
  4. firebase emulators:start
    image
  5. Yes
  6. https://pastebin.com/P42AGzjb
  7. See above

from firebase-unity-sdk.

dconeybe avatar dconeybe commented on May 27, 2024

Hmm everything looks good. I have no idea what that error means. Since "permission denied" is in the message, is there a chance that your firewall (e.g. Windows Defender) is blocking the connection?

Also, could you try exiting the Unity Editor and deleting the local cache by running

rd /s /q %USERPROFILE%\AppData\Local\firestore

from firebase-unity-sdk.

dex3r avatar dex3r commented on May 27, 2024

I've turned off the windows firewall but the problem persists. Removing the cache also did not help.

from firebase-unity-sdk.

dex3r avatar dex3r commented on May 27, 2024

@dconeybe thank you, that was it. I would have never guessed it was this simple since the error message was non-existing on google :)

from firebase-unity-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.